Skip to content

Commit

Permalink
Fix comments; 'Fix'-ish occasionally broken activation mails
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasDeBruijn committed Sep 1, 2024
1 parent b8d1161 commit dd90202
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion app/mailers/mailings/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ class Devise < ApplicationMailer
include ::Devise::Controllers::UrlHelpers

def confirmation_instructions(record, token, _opts = {})
url = new_member_confirmation_url(record, confirmation_token: token)
Rails.logger.debug("Sending confirmation instructions")

url = confirmation_url(record, confirmation_token: token)
# FIXME: confirmation_url might occassionaly return an url to the activation page. We don't know why
url = url.sub("activation", "activate")

Rails.logger.debug(url) if Rails.env.development?

html = render_to_string(locals: {
Expand All @@ -28,7 +33,12 @@ def confirmation_instructions(record, token, _opts = {})
end

def activation_instructions(record, token, _opts = {})
Rails.logger.debug("Sending activation instructions");

url = new_member_confirmation_url(confirmation_token: token)
# FIXME: confirmation_url might occassionaly return an url to the activation page. We don't know why
url = url.sub("confirmation", "activate")

Rails.logger.debug(url) if Rails.env.development?

html = render_to_string(locals: {
Expand Down
2 changes: 1 addition & 1 deletion config/locales/mailings.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ en:
account_activation_instructions: Activate your account by clicking the button below
account_activation_link: Activate your account for our member system by going to %{url}.
activate_account: Activate account
activity_updates_html: 'Do you always want to stay informed about these activities? Follow us on %{instagram_page_link_start} the Sticky-members Instagram %{link_end} and on %{linkedin_page_link_start} LinkedId %{link_end}! Aside from that, you can find all information that you could ever want on our website: %{sticky_site_link_start} svsticky.nl %{link_end}. You can also join our %{whatsapp_promo_link_start} WhatsApp promotion channel %{link_end} to be notified about upcoming activities!'
activity_updates_html: 'Do you always want to stay informed about these activities? Follow us on %{instagram_page_link_start} the Sticky-members Instagram%{link_end} and on %{linkedin_page_link_start} LinkedId%{link_end}! Aside from that, you can find all information that you could ever want on our website: %{sticky_site_link_start} svsticky.nl%{link_end}. You can also join our %{whatsapp_promo_link_start} WhatsApp promotion channel%{link_end} to be notified about upcoming activities!'
and_now: And now?
corner_stones:
business:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/mailings.nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nl:
account_activation_instructions: 'Activeer je account door op onderstaande knop te klikken:'
account_activation_link: Activeer je account voor ons ledenbeheersysteem door naar %{url} te gaan.
activate_account: Activeer account
activity_updates_html: 'Altijd op de hoogte blijven van deze activiteiten? Volg ons op %{instagram_page_link_start} Instagram %{link_end} en op %{linkedin_page_link_start} LinkedIn %{link_end}! Daarnaast vind je alle informatie die je ooit had kunnen wensen op onze website: %{sticky_site_link_start} svsticky.nl %{link_end}. Je kunt ook lid worden van onze %{whatsapp_promo_link_start} WhatsApp community %{link_end} om altijd op de hoogte gehouden te worden van aankomende activiteiten!'
activity_updates_html: 'Altijd op de hoogte blijven van deze activiteiten? Volg ons op %{instagram_page_link_start} Instagram%{link_end} en op %{linkedin_page_link_start} LinkedIn%{link_end}! Daarnaast vind je alle informatie die je ooit had kunnen wensen op onze website: %{sticky_site_link_start} svsticky.nl%{link_end}. Je kunt ook lid worden van onze %{whatsapp_promo_link_start} WhatsApp community%{link_end} om altijd op de hoogte gehouden te worden van aankomende activiteiten!'
and_now: En nu?
corner_stones:
business:
Expand Down

0 comments on commit dd90202

Please sign in to comment.