diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 773fabb..fc37cca 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,8 +1,9 @@ class UserMailer < ActionMailer::Base default from: I18n.t('helpers.main_email.from') - def sharing_notification(role) + def sharing_notification(role, user) @role = role + @user = user mail(to: @role.user.email, subject: I18n.t('helpers.main_email.access_given')) end diff --git a/app/views/user_mailer/sharing_notification.html.erb b/app/views/user_mailer/sharing_notification.html.erb index cccfddf..5f36e6c 100644 --- a/app/views/user_mailer/sharing_notification.html.erb +++ b/app/views/user_mailer/sharing_notification.html.erb @@ -1,4 +1,4 @@ -

<%= _('Hello') %> <%= @role.user.name %>

+

<%= _('Hello ') %> <%= @role.user.name %>

<% access_level = "read-only" @@ -9,5 +9,8 @@ end %> -

<%= _('You have been given ') %><%= access_level %><%= _(' access to') %><%= link_to @role.plan.title, url_for(action: 'show', controller: 'plans', id: @role.plan.id, locale: I18n.default_locale) %>".

+

<%= _('You have been given ') %><%= access_level %><%= _(' access to ') %>"<%= link_to @role.plan.title, url_for(action: 'show', controller: 'plans', id: @role.plan.id, locale: I18n.default_locale) %>" <%=_(' by ')%><%= @user.name %>.

+

<%=_('Please follow the link above to login to ')%><%=Rails.configuration.branding[:application][:name]%><%=_(' to view/edit the plan')%>.

+

<%=_('Thanks')%>

+

<%=Rails.configuration.branding[:application][:name]%> <%=_(' team')%>

\ No newline at end of file