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
# Sends an email copy of the given internal foodsoft message.
def foodsoft_message(message, recipient)
def foodsoft_message(recipient, message)
@message = message
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}>"
end
mail subject: message.subject,
to: recipient,
mail to: recipient,
from: message.sender,
reply_to: reply_to
reply_to: reply_to,
subject: message.subject
end
end

View File

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