How to customize your mailboxer email template?

It automatically sends an email that says

You have a new message: subject

      You have received a new message:    


        Body      

      Visit http://example.com/ and go to your inbox for more info

Does anyone know how to customize this template? If possible, I would like to use i18n for this form template.

Thank!! .

+5
source share
1 answer

you need to create views for letters sent to the user, rails g mailboxer:views this will create two different folders in<your rails app>/app

1- notification_mailer - containing template files when a notification is sent to a user

2- message_mailer - containing template files when a message is sent to a user

You can change these templates.

Another thing you can do is uncomment / add these lines to /config/initializer/mailboxer.rb

config.notification_mailer = CustomNotificationMailer
config.message_mailer      = CustomMessageMailer

and create above two classes of mailers that should contain the following function

send_email

The parameters of this function and their implementation are given at this link. You will get an idea of ​​how to write your own send_mail function.

Mailer

Message Mailer

+8

All Articles