foodsoft/plugins/messages/app/mailers/messages_mailer.rb
Patrick Gansterer 32bd8f600b Use FoodsoftConfig[:email_sender] for sender address
Not every email provider allows sending messages from an unauthorized server.
2015-02-18 16:54:44 +01:00

12 lines
462 B
Ruby

class MessagesMailer < Mailer
# Sends an email copy of the given internal foodsoft message.
def foodsoft_message(message, recipient)
set_foodcoop_scope
@message = message
mail subject: "[#{FoodsoftConfig[:name]}] " + message.subject,
to: recipient.email,
from: "#{show_user(message.sender)} via Foodsoft <#{FoodsoftConfig[:email_sender]}>",
reply_to: "#{show_user(message.sender)} <#{message.sender.email}>"
end
end