Class: Decidim::Comments::CommentNotificationMailer
- Inherits:
-
ApplicationMailer
- Object
- ApplicationMailer
- Decidim::Comments::CommentNotificationMailer
- Defined in:
- app/mailers/decidim/comments/comment_notification_mailer.rb
Overview
A custom mailer for sending notifications to users when a comment is created.
Instance Method Summary collapse
- #comment_created(user, comment, commentable) ⇒ Object
- #reply_created(user, reply, comment, commentable) ⇒ Object
Instance Method Details
#comment_created(user, comment, commentable) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/mailers/decidim/comments/comment_notification_mailer.rb', line 9 def comment_created(user, comment, commentable) with_user(user) do @comment = comment @commentable = commentable @organization = commentable.organization subject = I18n.t("comment_created.subject", scope: "decidim.comments.mailer.comment_notification") mail(to: commentable..email, subject: subject) end end |
#reply_created(user, reply, comment, commentable) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'app/mailers/decidim/comments/comment_notification_mailer.rb', line 19 def reply_created(user, reply, comment, commentable) with_user(user) do @reply = reply @comment = comment @commentable = commentable @organization = commentable.organization subject = I18n.t("reply_created.subject", scope: "decidim.comments.mailer.comment_notification") mail(to: comment..email, subject: subject) end end |