Includes the document number and type in the verification email

This commit is contained in:
kikito
2015-10-02 18:40:24 +02:00
parent 8a1b01e985
commit 9e05a3283c
5 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
class Mailer < ApplicationMailer class Mailer < ApplicationMailer
helper :text_with_links helper :text_with_links
helper :mailer helper :mailer
helper :user
def comment(comment) def comment(comment)
@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? mail(to: @recipient.email, subject: t('mailers.reply.subject')) if @commentable.present? && @recipient.present?
end end
def email_verification(user, recipient, token) def email_verification(user, recipient, token, document_type, document_number)
@user = user @user = user
@recipient = recipient @recipient = recipient
@token = token @token = token
@document_type = document_type
@document_number = document_number
mail(to: @recipient, subject: t('mailers.email_verification.subject')) mail(to: @recipient, subject: t('mailers.email_verification.subject'))
end end

View File

@@ -22,7 +22,7 @@ class Verification::Management::Email
plain_token, encrypted_token = Devise.token_generator.generate(User, :email_verification_token) plain_token, encrypted_token = Devise.token_generator.generate(User, :email_verification_token)
user.update(email_verification_token: plain_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 true
end end

View File

@@ -9,6 +9,12 @@
t('mailers.email_verification.click_here_to_verify'), t('mailers.email_verification.click_here_to_verify'),
email_url(email_verification_token: @token))) %> email_url(email_verification_token: @token))) %>
</p> </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;"> <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") %> <%= t("mailers.email_verification.thanks") %>
</p> </p>

View File

@@ -15,5 +15,6 @@ en:
title: Please verify yourself title: Please verify yourself
instructions_html: "We need to verify you using this email, which we got from the Census. %{verification_link}" 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" 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" thanks: "Thanks"

View File

@@ -15,4 +15,5 @@ es:
title: Verifica tu cuenta con el siguiente enlace 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}." 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" 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." thanks: "Muchas gracias."