From dd90202e74f2cbe69595d39a67883fbeabcc81c9 Mon Sep 17 00:00:00 2001 From: Tobias de Bruijn Date: Sun, 1 Sep 2024 19:26:38 +0200 Subject: [PATCH] Fix comments; 'Fix'-ish occasionally broken activation mails --- app/mailers/mailings/devise.rb | 12 +++++++++++- config/locales/mailings.en.yml | 2 +- config/locales/mailings.nl.yml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/mailers/mailings/devise.rb b/app/mailers/mailings/devise.rb index 775d5bfd9..434b60d69 100644 --- a/app/mailers/mailings/devise.rb +++ b/app/mailers/mailings/devise.rb @@ -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: { @@ -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: { diff --git a/config/locales/mailings.en.yml b/config/locales/mailings.en.yml index 175b29897..bb796d234 100644 --- a/config/locales/mailings.en.yml +++ b/config/locales/mailings.en.yml @@ -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: diff --git a/config/locales/mailings.nl.yml b/config/locales/mailings.nl.yml index ee946ced4..ce195476e 100644 --- a/config/locales/mailings.nl.yml +++ b/config/locales/mailings.nl.yml @@ -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: