Includes the document number and type in the verification email
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
class Mailer < ApplicationMailer
|
||||
helper :text_with_links
|
||||
helper :mailer
|
||||
helper :user
|
||||
|
||||
def comment(comment)
|
||||
@comment = comment
|
||||
@@ -16,10 +17,12 @@ class Mailer < ApplicationMailer
|
||||
mail(to: @recipient.email, subject: t('mailers.reply.subject')) if @commentable.present? && @recipient.present?
|
||||
end
|
||||
|
||||
def email_verification(user, recipient, token)
|
||||
def email_verification(user, recipient, token, document_type, document_number)
|
||||
@user = user
|
||||
@recipient = recipient
|
||||
@token = token
|
||||
@document_type = document_type
|
||||
@document_number = document_number
|
||||
mail(to: @recipient, subject: t('mailers.email_verification.subject'))
|
||||
end
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class Verification::Management::Email
|
||||
|
||||
plain_token, encrypted_token = Devise.token_generator.generate(User, :email_verification_token)
|
||||
user.update(email_verification_token: plain_token)
|
||||
Mailer.email_verification(user, email, encrypted_token).deliver_later
|
||||
Mailer.email_verification(user, email, encrypted_token, document_type, document_number).deliver_later
|
||||
true
|
||||
end
|
||||
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
t('mailers.email_verification.click_here_to_verify'),
|
||||
email_url(email_verification_token: @token))) %>
|
||||
</p>
|
||||
|
||||
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
|
||||
<%= t("mailers.email_verification.instructions_2_html",
|
||||
document_type: humanize_document_type(@document_type),
|
||||
document_number: @document_number) %>
|
||||
</p>
|
||||
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
|
||||
<%= t("mailers.email_verification.thanks") %>
|
||||
</p>
|
||||
|
||||
@@ -15,5 +15,6 @@ en:
|
||||
title: Please verify yourself
|
||||
instructions_html: "We need to verify you using this email, which we got from the Census. %{verification_link}"
|
||||
click_here_to_verify: "Please click here to verify yourself"
|
||||
instructions_html_2: "This email will verify your account with <b>%{document_type} %{document_number}</b>. If these don't belong to you, please don't click on the previous link and ignore this email."
|
||||
thanks: "Thanks"
|
||||
|
||||
|
||||
@@ -15,4 +15,5 @@ es:
|
||||
title: Verifica tu cuenta con el siguiente enlace
|
||||
instructions_html: "Para terminar de verificar tu cuenta de usuario en el Portal de Gobierno Abierto del Ayuntamiento de Madrid, necesitamos que pulses %{verification_link}."
|
||||
click_here_to_verify: "en este enlace"
|
||||
instructions_2_html: "Este email es para verificar tu cuenta con <b>%{document_type} %{document_number}</b>. Si esos no son tus datos, por favor no pulses el enlace anterior e ignora este email."
|
||||
thanks: "Muchas gracias."
|
||||
|
||||
Reference in New Issue
Block a user