diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 74c67079..44595782 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -9,7 +9,7 @@ class UserMailer < ApplicationMailer mail( to: @user.email, - subject: default_i18n_subject(app_name: app_name, post: comment.post.title) + subject: t('mailers.user.notify_post_owner.subject', site_name: site_name, post: comment.post.title) ) end @@ -21,7 +21,7 @@ class UserMailer < ApplicationMailer mail( to: @user.email, - subject: default_i18n_subject(app_name: app_name, post: comment.post.title) + subject: t('mailers.user.notify_comment_owner.subject', site_name: site_name, post: comment.post.title) ) end @@ -32,7 +32,7 @@ class UserMailer < ApplicationMailer mail( to: comment.post.followers.pluck(:email), - subject: default_i18n_subject(app_name: app_name, post: comment.post.title) + subject: t('mailers.user.notify_followers_of_post_update.subject', site_name: site_name, post: comment.post.title) ) end @@ -43,13 +43,13 @@ class UserMailer < ApplicationMailer mail( to: post.followers.pluck(:email), - subject: default_i18n_subject(app_name: app_name, post: post.title) + subject: t('mailers.user.notify_followers_of_post_status_change.subject', site_name: site_name, post: post.title) ) end private - def app_name + def site_name Current.tenant_or_raise!.site_name end end \ No newline at end of file diff --git a/app/views/user_mailer/notify_followers_of_post_status_change.html.erb b/app/views/user_mailer/notify_followers_of_post_status_change.html.erb index eab74476..8cce3d17 100644 --- a/app/views/user_mailer/notify_followers_of_post_status_change.html.erb +++ b/app/views/user_mailer/notify_followers_of_post_status_change.html.erb @@ -1,7 +1,7 @@
- <%= t('mailers.user.notify_followers_of_post_status_change.body', post: @post) %> - > - <%= @post.post_status.name %> + <%= t('mailers.user.notify_followers_of_post_status_change.body', post: @post.title) %> + + <%= @post.post_status.name.upcase %>
diff --git a/config/locales/backend/backend.en.yml b/config/locales/backend/backend.en.yml index d37d8e5d..60202ac9 100644 --- a/config/locales/backend/backend.en.yml +++ b/config/locales/backend/backend.en.yml @@ -35,17 +35,17 @@ en: learn_more: 'Click here to learn more' unsubscribe: 'Annoyed? You can turn off notifications here' notify_post_owner: - subject: '[%{app_name}] New comment on %{post}' - body: 'There is a new comment by %{user} on your post %{post}' + subject: '[%{site_name}] New comment on "%{post}"' + body: 'There is a new comment by "%{user}" on your post "%{post}"' notify_comment_owner: - subject: '[%{app_name}] New reply on your comment from %{post}' - body: 'There is a new reply by %{user} on your comment from post %{post}' + subject: '[%{site_name}] New reply on your comment on post "%{post}"' + body: 'There is a new reply by "%{user}" on your comment from post "%{post}"' notify_followers_of_post_update: - subject: '[%{app_name}] New update for post %{post}' - body: "There is a new update on the post you're following %{post}" + subject: '[%{site_name}] New update for post "%{post}"' + body: 'There is a new update on the post you are following "%{post}"' notify_followers_of_post_status_change: - subject: '[%{app_name}] Status change on post %{post}' - body: "The post you're following %{post} has a new status" + subject: '[%{site_name}] Status change on post "%{post}"' + body: 'There is a status update on the post you are following "%{post}"' activerecord: models: board: