From 1671afae42ab1b76b54c0a69d4cc4df48afb5a79 Mon Sep 17 00:00:00 2001 From: Ben <95949082+kasugaijin@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:02:30 -0800 Subject: [PATCH] reimplement how we handled script name for mailers and fix the production config to remove the trailing / because it was resulting in URLs with two slashes before the slug... (#1215) --- app/mailers/sign_up_mailer.rb | 2 +- app/views/adoption_mailer/new_adoption.html.erb | 2 +- app/views/foster_mailer/new_foster.html.erb | 2 +- .../organization_mailer/create_new_org_and_admin.html.erb | 4 ++-- app/views/sign_up_mailer/adopter_welcome_email.html.erb | 6 +++--- config/environments/production.rb | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/mailers/sign_up_mailer.rb b/app/mailers/sign_up_mailer.rb index 39df64c7f..0d591790c 100644 --- a/app/mailers/sign_up_mailer.rb +++ b/app/mailers/sign_up_mailer.rb @@ -3,6 +3,6 @@ def adopter_welcome_email(current_tenant) @organization = current_tenant @user = params[:user] - mail(to: @user.email, subject: "Welcome to #{@organization.name}") + mail(to: @user.email, subject: "No Reply: Welcome to #{@organization.name}") end end diff --git a/app/views/adoption_mailer/new_adoption.html.erb b/app/views/adoption_mailer/new_adoption.html.erb index a71de5e92..461b28a1c 100644 --- a/app/views/adoption_mailer/new_adoption.html.erb +++ b/app/views/adoption_mailer/new_adoption.html.erb @@ -6,7 +6,7 @@

Congrats on <%= @pet.name %>'s adoption!

-

To view <%= @pet.name %>'s tasks and downloadable files, please go to your <%= link_to "Adopted Pets", adopter_fosterer_adopted_pets_url(script_name: "#{@organization.slug}"), target: "_blank" %> page.

+

To view <%= @pet.name %>'s tasks and downloadable files, please go to your <%= link_to "Adopted Pets", adopter_fosterer_adopted_pets_url(script_name: "/#{@organization.slug}"), target: "_blank" %> page.

Have a great day!

diff --git a/app/views/foster_mailer/new_foster.html.erb b/app/views/foster_mailer/new_foster.html.erb index fa791b0e4..9ea9181b1 100644 --- a/app/views/foster_mailer/new_foster.html.erb +++ b/app/views/foster_mailer/new_foster.html.erb @@ -11,7 +11,7 @@

Foster Start Date: <%= @foster.start_date.strftime("%Y-%m-%d") %>

Foster End Date: <%= @foster.end_date.strftime("%Y-%m-%d") %>

-

To view <%= @pet.name %>'s tasks and downloadable files, please go to your <%= link_to "Fostered Pets", adopter_fosterer_fostered_pets_url(script_name: "#{@organization.slug}"), target: "_blank" %> page.

+

To view <%= @pet.name %>'s tasks and downloadable files, please go to your <%= link_to "Fostered Pets", adopter_fosterer_fostered_pets_url(script_name: "/#{@organization.slug}"), target: "_blank" %> page.

Please do not reply directly to this email. You must contact <%= @organization.name %> directly at <%= @organization.email %> diff --git a/app/views/organization_mailer/create_new_org_and_admin.html.erb b/app/views/organization_mailer/create_new_org_and_admin.html.erb index 936886cad..6f3026536 100644 --- a/app/views/organization_mailer/create_new_org_and_admin.html.erb +++ b/app/views/organization_mailer/create_new_org_and_admin.html.erb @@ -7,7 +7,7 @@

<%= @user.first_name %>, thank you for registering <%= @organization.name %> with Homeward Tails

- You can access your site at: <%= link_to "#{root_url}#{@organization.slug}", home_index_url(script_name: "#{@organization.slug}"), target: "_blank" %> + You can access your site at: <%= link_to "#{root_url}#{@organization.slug}", home_index_url(script_name: "/#{@organization.slug}"), target: "_blank" %>

@@ -23,7 +23,7 @@

- <%= link_to "Log-in", new_user_session_url(script_name: "#{@organization.slug}"), target: "_blank" %> + <%= link_to "Log-in", new_user_session_url(script_name: "/#{@organization.slug}"), target: "_blank" %>

Homeward Tails Team diff --git a/app/views/sign_up_mailer/adopter_welcome_email.html.erb b/app/views/sign_up_mailer/adopter_welcome_email.html.erb index d61e0412b..737affac0 100644 --- a/app/views/sign_up_mailer/adopter_welcome_email.html.erb +++ b/app/views/sign_up_mailer/adopter_welcome_email.html.erb @@ -12,18 +12,18 @@
  • Complete the adopter questionnaire
  • Browse available pets and find one that is a good fit for you
  • Click on the 'Apply' button on your favourite pet's page
  • -
  • Check the Applications page for a summary of your applications
  • +
  • Check your Dashboard > Applications page for a summary of your applications
  • Await contact from us for a conversation about you, the pet, and the process
  • Still have questions? -

    Check out the <%= link_to "FAQ page", faq_index_url(script_name: "#{@organization.slug}"), target: "_blank" %>.

    +

    Check out the <%= link_to "FAQ page", faq_index_url(script_name: "/#{@organization.slug}"), target: "_blank" %>.

    Again, thank you for signing up! People like you help these pets live their best life.

    - - <%= @organization.name %> Team
    >www.homewardtails.org/<%= @organization.slug %>
    +
    Please do not reply directly to this email. You must contact <%= @organization.name %> directly at <%= @organization.email %> diff --git a/config/environments/production.rb b/config/environments/production.rb index 7f813592b..4d0996bae 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -67,7 +67,7 @@ config.action_mailer.perform_caching = false # devise mailer (e.g. reset password) - config.action_mailer.default_url_options = {host: "https://www.homewardtails.org/"} + config.action_mailer.default_url_options = {host: "https://www.homewardtails.org"} config.action_mailer.default_options = {from: "homewardtails@gmail.com"} # Ignore bad email addresses and do not raise email delivery errors.