Issue#15: Added Comment Notifications: notification_emails and comments view

This commit is contained in:
raluka 2015-07-17 18:55:47 +02:00
parent 37697517df
commit 35714f350e
16 changed files with 155 additions and 13 deletions

View file

@ -80,6 +80,22 @@ class Mailbot < ActionMailer::Base
end
end
def send_notification_email_for_comment(comment)
@comment = comment
@event = @comment.commentable
@conference = @event.conference
recipients = User.comment_notifiable(@conference) # with scope
recipients.each do |user|
@user = user
mail(to: @user.email,
from: @conference.contact.email,
reply_to: @conference.contact.email,
template_path: 'admin/emails',
template_name: 'comment_template',
subject: "New comment has been posted for #{@event.title}")
end
end
def build_email(conference, to, subject, body)
mail(to: to,
from: conference.contact.email,