Align MessagesMailer argument order with Mailer

This commit is contained in:
Patrick Gansterer 2017-08-18 01:23:11 +02:00
parent d93aa23d1c
commit 0ed3b7b7c3
2 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
class MessagesMailer < Mailer class MessagesMailer < Mailer
# Sends an email copy of the given internal foodsoft message. # Sends an email copy of the given internal foodsoft message.
def foodsoft_message(message, recipient) def foodsoft_message(recipient, message)
@message = message @message = message
reply_email_domain = FoodsoftConfig[:reply_email_domain] reply_email_domain = FoodsoftConfig[:reply_email_domain]
@ -9,9 +9,9 @@ class MessagesMailer < Mailer
reply_to = "#{I18n.t('layouts.foodsoft')} <#{FoodsoftConfig.scope}.#{message.id}.#{recipient.id}.#{hash}@#{reply_email_domain}>" reply_to = "#{I18n.t('layouts.foodsoft')} <#{FoodsoftConfig.scope}.#{message.id}.#{recipient.id}.#{hash}@#{reply_email_domain}>"
end end
mail subject: message.subject, mail to: recipient,
to: recipient,
from: message.sender, from: message.sender,
reply_to: reply_to reply_to: reply_to,
subject: message.subject
end end
end end

View file

@ -8,7 +8,7 @@ class MessageNotifier < UserNotifier
message.recipients.each do |recipient| message.recipients.each do |recipient|
if recipient.receive_email? if recipient.receive_email?
begin begin
MessagesMailer.foodsoft_message(message, recipient).deliver MessagesMailer.foodsoft_message(recipient, message).deliver
rescue rescue
Rails.logger.warn "Deliver failed for user \##{recipient.id}: #{recipient.email}" Rails.logger.warn "Deliver failed for user \##{recipient.id}: #{recipient.email}"
end end