From 0ed3b7b7c3b4e32d3490b39d66aa523ee24bd848 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Fri, 18 Aug 2017 01:23:11 +0200 Subject: [PATCH] Align MessagesMailer argument order with Mailer --- plugins/messages/app/mailers/messages_mailer.rb | 8 ++++---- plugins/messages/app/workers/message_notifier.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/messages/app/mailers/messages_mailer.rb b/plugins/messages/app/mailers/messages_mailer.rb index d4b3a128..000ac11c 100644 --- a/plugins/messages/app/mailers/messages_mailer.rb +++ b/plugins/messages/app/mailers/messages_mailer.rb @@ -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 diff --git a/plugins/messages/app/workers/message_notifier.rb b/plugins/messages/app/workers/message_notifier.rb index 571c0ee1..5c6b2203 100644 --- a/plugins/messages/app/workers/message_notifier.rb +++ b/plugins/messages/app/workers/message_notifier.rb @@ -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