diff --git a/app/mailers/invitations_mailer.rb b/app/mailers/invitations_mailer.rb index 1e1e480..5186cff 100644 --- a/app/mailers/invitations_mailer.rb +++ b/app/mailers/invitations_mailer.rb @@ -1,8 +1,7 @@ class InvitationsMailer < ApplicationMailer def received_invitation - profile = Profile.find(params[:profile_id]) - project_title = params[:project_title] - mail(subject: t('.subject'), to: profile.user.email, - body: t('.body', title: project_title)) + @profile = Profile.find(params[:profile_id]) + @project_title = params[:project_title] + mail(subject: t('.subject'), to: @profile.user.email) end end diff --git a/app/views/connections_mailer/notify_follow.html.erb b/app/views/connections_mailer/notify_follow.html.erb index e447029..766b5c5 100644 --- a/app/views/connections_mailer/notify_follow.html.erb +++ b/app/views/connections_mailer/notify_follow.html.erb @@ -2,6 +2,6 @@
<%= link_to @notification.notifiable.follower.full_name, profile_url(@notification.notifiable.follower) %> <%= t('notifications.started_following_you') %>
-<%= link_to t('click_btn'), profile_url(@notification.profile) %> <%= t('.access_profile') %>
-<%= t('.regards') %>, +<%= link_to t('click_btn'), @notification.profile %> <%= t('.access_profile') %>
+<%= t('.regards') %>Portfoliorrr
\ No newline at end of file diff --git a/app/views/invitations_mailer/received_invitation.html.erb b/app/views/invitations_mailer/received_invitation.html.erb new file mode 100644 index 0000000..0a1d558 --- /dev/null +++ b/app/views/invitations_mailer/received_invitation.html.erb @@ -0,0 +1,7 @@ +<%= t('.greeting', recipient: @profile.full_name) %>
+ +<%= t('.body', title: @project_title) %>
+ +<%= link_to t('click_btn'), invitations_url %> <%= t('.access_invitations') %>
+<%= t('.regards') %> +Portfoliorrr
\ No newline at end of file diff --git a/config/locales/models/connections.pt-BR.yml b/config/locales/models/connections.pt-BR.yml index 7701ae9..07cd5f6 100644 --- a/config/locales/models/connections.pt-BR.yml +++ b/config/locales/models/connections.pt-BR.yml @@ -32,4 +32,4 @@ pt-BR: subject: 'Alguém seguiu seu perfil' greeting: Olá, %{recipient}! access_profile: para acessar seu perfil e continuar interagindo. - regards: Abraços \ No newline at end of file + regards: Abraços, \ No newline at end of file diff --git a/config/locales/models/invitation.pt-BR.yml b/config/locales/models/invitation.pt-BR.yml index 019e826..c17d43b 100644 --- a/config/locales/models/invitation.pt-BR.yml +++ b/config/locales/models/invitation.pt-BR.yml @@ -32,5 +32,8 @@ pt-BR: invitations_mailer: received_invitation: + greeting: Olá, %{recipient}! subject: 'Você recebeu um convite' - body: Você recebeu um convite para participar do projeto %{title}. + body: Você recebeu um convite para participar do projeto %{title}. + access_invitations: para ver seus convites e aceitá-los. + regards: Abraços, diff --git a/spec/mailer/connections_mailer_spec.rb b/spec/mailer/connections_mailer_spec.rb index 9656f87..ecffb2f 100644 --- a/spec/mailer/connections_mailer_spec.rb +++ b/spec/mailer/connections_mailer_spec.rb @@ -14,7 +14,8 @@ expect(mail.subject).to include 'Alguém seguiu seu perfil' expect(mail.to).to eq [followed_profile.email] expect(mail.from).to eq ['notifications@portfoliorrr.com'] - expect(mail.body).to include 'Danilo Martins começou a seguir você' + expect(mail.body).to include "" + expect(mail.body).to include 'Danilo Martins começou a seguir você' end end end