From 3f67baa2f3e63e71b6db876674c4bd1906c35763 Mon Sep 17 00:00:00 2001 From: Jerin K C <58975326+jerinkc@users.noreply.github.com> Date: Wed, 2 Aug 2023 20:16:09 +0530 Subject: [PATCH] Fix broken contact link in email (#19858) * Contact us info update * Update contact info in other emails * Spec update --- .../account_deleted_email.html.erb | 3 ++- .../account_deletion_requested_email.html.erb | 3 ++- .../account_deletion_requested_email.text.erb | 3 ++- .../organization_deleted_email.html.erb | 3 ++- .../organization_deleted_email.text.erb | 2 +- spec/mailers/notify_mailer_spec.rb | 21 +++++++++++++++++++ 6 files changed, 30 insertions(+), 5 deletions(-) diff --git a/app/views/mailers/notify_mailer/account_deleted_email.html.erb b/app/views/mailers/notify_mailer/account_deleted_email.html.erb index f206d89ea..5c3d99bee 100644 --- a/app/views/mailers/notify_mailer/account_deleted_email.html.erb +++ b/app/views/mailers/notify_mailer/account_deleted_email.html.erb @@ -7,7 +7,8 @@
- <%= t("contact_prompts.if_we_can_help_html") %> 😊 + Contact us at <%= ForemInstance.contact_email %> + if there is anything more we can help with.
diff --git a/app/views/mailers/notify_mailer/account_deletion_requested_email.html.erb b/app/views/mailers/notify_mailer/account_deletion_requested_email.html.erb index ed5d73d88..c50512453 100644 --- a/app/views/mailers/notify_mailer/account_deletion_requested_email.html.erb +++ b/app/views/mailers/notify_mailer/account_deletion_requested_email.html.erb @@ -8,7 +8,8 @@
- <%= t("contact_prompts.if_we_can_help_html") %> 😊 + Contact us at <%= ForemInstance.contact_email %> + if there is anything more we can help with.
diff --git a/app/views/mailers/notify_mailer/account_deletion_requested_email.text.erb b/app/views/mailers/notify_mailer/account_deletion_requested_email.text.erb index 3b01dc46e..58463bb29 100644 --- a/app/views/mailers/notify_mailer/account_deletion_requested_email.text.erb +++ b/app/views/mailers/notify_mailer/account_deletion_requested_email.text.erb @@ -1,6 +1,7 @@ Hi <%= @name %>, Your account deletion was requested. Please, visit this page: <%= user_confirm_destroy_url(@token) %> to destroy your account. The link will expire in 12 hours. -<%= t("contact_prompts.if_we_can_help_html") %> + +Contact us at <%= ForemInstance.contact_email %> if there is anything more we can help with. Thanks, The <%= community_name %> Team diff --git a/app/views/mailers/notify_mailer/organization_deleted_email.html.erb b/app/views/mailers/notify_mailer/organization_deleted_email.html.erb index 68e46d63a..a71177e7a 100644 --- a/app/views/mailers/notify_mailer/organization_deleted_email.html.erb +++ b/app/views/mailers/notify_mailer/organization_deleted_email.html.erb @@ -7,7 +7,8 @@
- <%= t("contact_prompts.if_we_can_help_html") %> 😊 + Contact us at <%= ForemInstance.contact_email %> + if there is anything more we can help with.
diff --git a/app/views/mailers/notify_mailer/organization_deleted_email.text.erb b/app/views/mailers/notify_mailer/organization_deleted_email.text.erb index 783e40251..c5f47c0db 100644 --- a/app/views/mailers/notify_mailer/organization_deleted_email.text.erb +++ b/app/views/mailers/notify_mailer/organization_deleted_email.text.erb @@ -2,7 +2,7 @@ Hi <%= @name %>. Your organization <%= @org_name %> on <%= community_name %> has been successfully deleted. -<%= t("contact_prompts.if_we_can_help_html") %> +Contact us at <%= ForemInstance.contact_email %> if there is anything more we can help with. Thanks, The <%= community_name %> Team diff --git a/spec/mailers/notify_mailer_spec.rb b/spec/mailers/notify_mailer_spec.rb index 56c274048..820d64aef 100644 --- a/spec/mailers/notify_mailer_spec.rb +++ b/spec/mailers/notify_mailer_spec.rb @@ -7,6 +7,7 @@ RSpec.describe NotifyMailer do let(:organization) { create(:organization) } let(:organization_membership) { create(:organization_membership, user: user, organization: organization) } let(:comment) { create(:comment, user_id: user.id, commentable: article) } + let(:token) { "secret" } describe "#new_reply_email" do let(:email) { described_class.with(comment: comment).new_reply_email } @@ -331,6 +332,22 @@ RSpec.describe NotifyMailer do it "renders proper receiver" do expect(email.to).to eq([user.email]) end + + it "includes contact email" do + expect(email.html_part.body).to include(ForemInstance.contact_email) + end + end + + describe "#account_deletion_requested_email" do + let(:email) do + described_class.with(user: user, token: token).account_deletion_requested_email + end + + include_examples "#renders_proper_email_headers" + + it "includes contact email" do + expect(email.html_part.body).to include(ForemInstance.contact_email) + end end describe "#organization_deleted_email" do @@ -347,6 +364,10 @@ RSpec.describe NotifyMailer do it "renders proper receiver" do expect(email.to).to eq([user.email]) end + + it "includes contact email" do + expect(email.html_part.body).to include(ForemInstance.contact_email) + end end describe "#export_email" do