How to send automatic emails after saving a record?

0
How to send automatic emails after saving a record?
asked
1 answers
1

You can create an After Commit event handler on the entity for which you want to send an email. Within the microflow of this event handler, you can create an email message and send it. If you send emails using an email service with a REST API, you can create the respective message also in this microflow. If you send emails via SMTP, you should import the Appstore Module “E-mail module with templates” (https://docs.mendix.com/appstore/modules/email-with-templates) – do not forget to import all dependencies (MxModelReflection, Encryption) as well. And, one might find it to be good practice to only create an event in the event handler, which will be picked up by a scheduled event which will then create the email message.

However, depending on your app and use case, sending an email when saving a record will most likely spam the email account, so think about a logic that will only send out meaningful emails.  

answered