From c9fad26ce34c8a7be738011b6cb68031d3a3a963 Mon Sep 17 00:00:00 2001 From: Harsha Bana Date: Thu, 28 Nov 2024 18:57:46 -0500 Subject: [PATCH] 4788 - Fixing Partner Message On Invite Email (#4805) --- app/views/users/mailer/invitation_instructions.html.erb | 1 + docs/user_guide/bank/getting_started_customization.md | 2 ++ spec/mailers/custom_devise_mailer_spec.rb | 2 ++ 3 files changed, 5 insertions(+) diff --git a/app/views/users/mailer/invitation_instructions.html.erb b/app/views/users/mailer/invitation_instructions.html.erb index ca9501789c..7d959b4882 100644 --- a/app/views/users/mailer/invitation_instructions.html.erb +++ b/app/views/users/mailer/invitation_instructions.html.erb @@ -346,6 +346,7 @@

Hello <%= @resource.email %>

<% if @resource.partner.present? && is_primary_partner %>

You've been invited to become a partner with <%= organization.name %>!

+

<%= organization.invitation_text %>

Please click the link below to accept your invitation and create an account and you'll be able to begin requesting distributions.

Please contact <%= organization.email %> if you are encountering any issues.

<% elsif @resource.partner.present? && !is_primary_partner %> diff --git a/docs/user_guide/bank/getting_started_customization.md b/docs/user_guide/bank/getting_started_customization.md index 3265eabc3a..28fceedd3f 100644 --- a/docs/user_guide/bank/getting_started_customization.md +++ b/docs/user_guide/bank/getting_started_customization.md @@ -115,6 +115,8 @@ Hello [Partner's email] You've been invited to become a partner with Pawnee Diaper Bank! +[Customer Partner Invitation Message If Present] + Please click the link below to accept your invitation and create an account and you'll be able to begin requesting Distributions. Please contact [Bank's email] if you are encountering any issues. diff --git a/spec/mailers/custom_devise_mailer_spec.rb b/spec/mailers/custom_devise_mailer_spec.rb index cf497921c2..842c9d7541 100644 --- a/spec/mailers/custom_devise_mailer_spec.rb +++ b/spec/mailers/custom_devise_mailer_spec.rb @@ -7,6 +7,7 @@ let(:partner) do partner = create(:partner, :uninvited) partner.primary_user.delete + partner.organization.update!(invitation_text: "Custom Invitation Text") partner.reload partner end @@ -17,6 +18,7 @@ it "invites to primary user" do expect(mail.subject).to eq("You've been invited to be a partner with #{user.partner.organization.name}") + expect(mail.html_part.body).to include(partner.organization.invitation_text) expect(mail.html_part.body).to include("You've been invited to become a partner with #{user.partner.organization.name}!") end end