Skip to content

Commit

Permalink
reimplement how we handled script name for mailers and fix the produc…
Browse files Browse the repository at this point in the history
…tion config to remove the trailing / because it was resulting in URLs with two slashes before the slug... (#1215)
  • Loading branch information
kasugaijin authored Dec 7, 2024
1 parent cf34a4f commit 1671afa
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/mailers/sign_up_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/views/adoption_mailer/new_adoption.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<body>
<h1>Congrats on <%= @pet.name %>'s adoption!</h1>

<p>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.</p>
<p>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.</p>

<p>Have a great day!</p>

Expand Down
2 changes: 1 addition & 1 deletion app/views/foster_mailer/new_foster.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<h4>Foster Start Date: <%= @foster.start_date.strftime("%Y-%m-%d") %></h4>
<h4>Foster End Date: <%= @foster.end_date.strftime("%Y-%m-%d") %></h4>

<p>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.</p>
<p>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.</p>

<strong>Please do not reply directly to this email. You must contact <%= @organization.name %> directly at <a href="mailto:<%= @organization.email %>"><%= @organization.email %></a></strong>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h1><%= @user.first_name %>, thank you for registering <%= @organization.name %> with Homeward Tails</h1>

<p>
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" %>
</p>

<p>
Expand All @@ -23,7 +23,7 @@
</p>

<p>
<%= 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" %>
</p>

<strong>Homeward Tails Team</strong>
Expand Down
6 changes: 3 additions & 3 deletions app/views/sign_up_mailer/adopter_welcome_email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
<li>Complete the adopter questionnaire</li>
<li>Browse available pets and find one that is a good fit for you</li>
<li>Click on the 'Apply' button on your favourite pet's page</li>
<li>Check the Applications page for a summary of your applications</li>
<li>Check your Dashboard > Applications page for a summary of your applications</li>
<li>Await contact from us for a conversation about you, the pet, and the process</li>
</ol>

<strong>Still have questions?</strong>
<p>Check out the <%= link_to "FAQ page", faq_index_url(script_name: "#{@organization.slug}"), target: "_blank" %>.</p>
<p>Check out the <%= link_to "FAQ page", faq_index_url(script_name: "/#{@organization.slug}"), target: "_blank" %>.</p>
<p>Again, thank you for signing up! People like you help these pets live their best life.</p>

<strong>- <%= @organization.name %> Team</strong>
<br>
<a href=<% @org_root %>>www.homewardtails.org/<%= @organization.slug %></a>
<br>
<br>
<strong>Please do not reply directly to this email. You must contact <%= @organization.name %> directly at <a href="mailto:<%= @organization.email %>"><%= @organization.email %></a></strong>
</body>
</html>
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]"}

# Ignore bad email addresses and do not raise email delivery errors.
Expand Down

0 comments on commit 1671afa

Please sign in to comment.