I've just installed Mailboxer (gem 'mailboxer'
) in my Rails 3.1.1 app… I have the email notifications working.
I followed these instructions to customize the notification email that users receive when they are sent a new message via the Mailboxer engine on my app… This allows me to edit the contents of the email message they receive, but I want to change the 'Subject' in the email header from the default "Mailboxer new message:" to a customized subject.
I'm assuming there might be a line I can add to the mailboxer.rb
config file?!?!?
Can anyone help on this?
just change your en.yml file and set your own subjects:
mailboxer.message_mailer.subject_new
mailboxer.message_mailer.subject_reply
the "subject" var contains the mailboxer-message subject. Ex:
en:
mailboxer:
message_mailer:
subject_new: 'Hey, you receive a new message about %{subject}'
subject_reply: 'Hey, you receive a new reply about %{subject}'
PS: any time you can test the result at console with:
I18n.translate("mailboxer.message_mailer.subject_new", :subject => "hello")
* just change the "hello" for your actual subject
So, I totally missed the obvious on this one... Just need to add a custom mailer, then you have full control.
Add the following to the mailboxer.rb
config file:
Mailboxer.setup do |config|
config.notification_mailer = CustomNotificationMailer
config.message_mailer = CustomMessageMailer
...
end
As clearly noted in the wiki, here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With