Fix mailers for post and comment notifications (#293)

This commit is contained in:
Riccardo Graziosi
2024-02-24 19:18:55 +01:00
committed by GitHub
parent 1d6c5fd947
commit 7966e80421
3 changed files with 16 additions and 16 deletions

View File

@@ -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

View File

@@ -1,7 +1,7 @@
<p>
<%= t('mailers.user.notify_followers_of_post_status_change.body', post: @post) %>
<span style='background-color: <%= @post.post_status.color %>; color: white;'%>>
<%= @post.post_status.name %>
<%= t('mailers.user.notify_followers_of_post_status_change.body', post: @post.title) %>
<span style='color: white; border-radius: 10rem; padding: 0.5rem; background-color: <%= @post.post_status.color %>;'>
<%= @post.post_status.name.upcase %>
</span>
</p>