I came across a great question in the forums this week, where the poster had created a custom module but wanted to customize the assignment notification email that goes out to the user once a record is assigned to them. By default, we have a rather generic one, but two quick and easy modifications allow changing the email content.
First off, we need to define the method set_notification_body() in our custom module’s bean class. This method will allow you to specify template fields for the email template ( my_module is the name of your module in the code example below ).
Next, we need to copy the default include/language/en_us.notify_template.html template file to custom/include/language/en_us.notify_template.html to make our changes to the file in an upgrade-safe way. At the end of this file, you’ll want to add what your module’s email template should be ( my_module is the name of your module in the code example below ).
With that, the next time you assign a record to a user in the module, it will use the new template you defined.