improves emails

Adds texts and i18n, ready to add design now.
Advances #221
This commit is contained in:
Juanjo Bazán
2015-08-21 23:01:51 +02:00
parent a9a8359bc7
commit c08d2cdf08
6 changed files with 25 additions and 9 deletions

View File

@@ -10,7 +10,8 @@ class Mailer < ApplicationMailer
@reply = reply @reply = reply
@debate = @reply.debate @debate = @reply.debate
parent = Comment.find(@reply.parent_id) parent = Comment.find(@reply.parent_id)
mail(to: parent.author.email, subject: t('mailer.reply.subject')) @recipient = parent.author
mail(to: @recipient.email, subject: t('mailer.reply.subject'))
end end
end end

View File

@@ -1,7 +1,6 @@
Hello, <%= t('mailers.comment.hi', recipient: @debate.author.name) %>
<div><%= @comment.author.name %></div> <div><%= link_to @debate.title, debate_url(@debate) %></div>
<div><%= t('mailers.comment.new_comment_by', commenter: @comment.author.name) %></div>
<div><%= @comment.body %></div> <div><%= @comment.body %></div>
<div><%= link_to @debate.title, debate_url(@debate) %></div>

View File

@@ -1,7 +1,6 @@
Hello, <%= t('mailers.reply.hi', recipient: @recipient.name) %>
<div><%= @reply.author.name %></div> <div><%= link_to @debate.title, debate_url(@debate) %></div>
<div><%= t('mailers.reply.new_reply_by', commenter: @reply.author.name) %></div>
<div><%= @reply.body %></div> <div><%= @reply.body %></div>
<div><%= link_to @debate.title, debate_url(@debate) %></div>

View File

@@ -24,6 +24,7 @@ data:
- config/locales/%{locale}.yml - config/locales/%{locale}.yml
- config/locales/admin.%{locale}.yml - config/locales/admin.%{locale}.yml
- config/locales/moderation.%{locale}.yml - config/locales/moderation.%{locale}.yml
- config/locales/mailers.%{locale}.yml
- config/locales/devise_views.%{locale}.yml - config/locales/devise_views.%{locale}.yml
- config/locales/responders.%{locale}.yml - config/locales/responders.%{locale}.yml
- config/locales/kaminari.%{locale}.yml - config/locales/kaminari.%{locale}.yml

View File

@@ -0,0 +1,8 @@
en:
mailers:
comment:
hi: "Hello, %{recipient}"
new_comment_by: "There'is a new comment by %{commenter}"
reply:
hi: "Hello, %{recipient}"
new_reply_by: "There'is a new reply by %{commenter} to your comment"

View File

@@ -0,0 +1,8 @@
es:
mailers:
comment:
hi: "Hola, %{recipient}"
new_comment_by: "Hay un nuevo comentario de %{commenter}"
reply:
hi: "Hola, %{recipient}"
new_reply_by: "Hay una nueva respuesta de %{commenter} a tu comentario"