Allow User objects in From mail field and set Reply-To if not set already

This commit is contained in:
Patrick Gansterer 2017-08-18 00:25:17 +02:00
parent b5c9634315
commit c71b91a32f
2 changed files with 7 additions and 4 deletions

View file

@ -7,13 +7,11 @@ class MessagesMailer < Mailer
if reply_email_domain
hash = message.mail_hash_for_user recipient
reply_to = "#{I18n.t('layouts.foodsoft')} <#{FoodsoftConfig.scope}.#{message.id}.#{recipient.id}.#{hash}@#{reply_email_domain}>"
else
reply_to = "#{show_user(message.sender)} <#{message.sender.email}>"
end
mail subject: message.subject,
to: recipient,
from: "#{show_user(message.sender)} via #{I18n.t('layouts.foodsoft')} <#{FoodsoftConfig[:email_sender]}>",
from: message.sender,
reply_to: reply_to
end
end