FIX: missing email notifications for group mentions

This commit is contained in:
Sam 2015-12-01 12:12:55 +11:00
parent aa2f802247
commit 1f7c03df5c
2 changed files with 9 additions and 1 deletions

View File

@ -57,9 +57,10 @@ module Jobs
return skip(skip_reason) if skip_reason
# Make sure that mailer exists
raise Discourse::InvalidParameters.new(:type) unless UserNotifications.respond_to?(args[:type])
raise Discourse::InvalidParameters.new("type=#{args[:type]}") unless UserNotifications.respond_to?(args[:type])
message = UserNotifications.send(args[:type], @user, email_args)
# Update the to address if we have a custom one
if args[:to_address].present?
message.to = [args[:to_address]]

View File

@ -113,6 +113,13 @@ class UserNotifications < ActionMailer::Base
notification_email(user, opts)
end
def group_mentioned(user, opts)
opts[:allow_reply_by_email] = true
opts[:use_site_subject] = true
opts[:show_category_in_subject] = true
notification_email(user, opts)
end
def user_posted(user, opts)
opts[:allow_reply_by_email] = true
opts[:use_site_subject] = true