improves emails
Adds texts and i18n, ready to add design now. Advances #221
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -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>
|
|
||||||
@@ -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
|
||||||
|
|||||||
8
config/locales/mailers.en.yml
Normal file
8
config/locales/mailers.en.yml
Normal 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"
|
||||||
8
config/locales/mailers.es.yml
Normal file
8
config/locales/mailers.es.yml
Normal 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"
|
||||||
Reference in New Issue
Block a user