diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 4da5c9b..c413d99 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -16,4 +16,9 @@ @project = project mail(to: @user.email, subject: "DMP access removed") end + + def api_token_granted_notification(user) + @user = user + mail(to: @user.email, subject: I18n.t('helper.api_mail_subject') + end end \ No newline at end of file diff --git a/app/views/user_mailer/api_token_granted_notification.html.erb b/app/views/user_mailer/api_token_granted_notification.html.erb new file mode 100644 index 0000000..817a6ff --- /dev/null +++ b/app/views/user_mailer/api_token_granted_notification.html.erb @@ -0,0 +1,6 @@ +

<% t('custom_devise.hello') %><%= @user.name %>

+ + +

+<% t('helpers.api_granted') %>"<%= link_to t('helpers.api_view_token'), controller: "users", action: "edit") %>". +

diff --git a/config/locales/en.yml b/config/locales/en.yml index 78677f9..7465458 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -353,6 +353,11 @@ error_registration_check: 'Error processing registration. Please check that you have entered a valid email address and that your chosen password is at least 8 characters long.' api_token: 'API token' api_info: 'API Information' + api_use: 'How to use the API' + api_granted: 'You have been granted permission by your organisation to use our API.' + api_view_token: 'Your API token and instructions for using the API endpoints can be found here.' + api_mail_subject: 'API Permission Granted' + text_area: "Text area" text_field: "Text field"