Class: Decidim::Comments::CommentNotificationMailer
- Inherits:
-
ApplicationMailer
- Object
- ApplicationMailer
- Decidim::Comments::CommentNotificationMailer
- Defined in:
- decidim-comments/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(comment, commentable) ⇒ Object
- #reply_created(reply, comment, commentable) ⇒ Object
Instance Method Details
#comment_created(comment, commentable) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'decidim-comments/app/mailers/decidim/comments/comment_notification_mailer.rb', line 12 def comment_created(comment, commentable) with_user(commentable.) do @comment = comment @commentable = commentable @locator = Decidim::ResourceLocatorPresenter.new(@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(reply, comment, commentable) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'decidim-comments/app/mailers/decidim/comments/comment_notification_mailer.rb', line 23 def reply_created(reply, comment, commentable) with_user(comment.) do @reply = reply @comment = comment @commentable = commentable @locator = Decidim::ResourceLocatorPresenter.new(@commentable) @organization = commentable.organization subject = I18n.t("reply_created.subject", scope: "decidim.comments.mailer.comment_notification") mail(to: comment..email, subject: subject) end end |