Email with Templates

Last update: Edit

1 Introduction

The Email with Templates module lets you send emails with templates. Email templates can be managed with the possibility of using tokens. With the tokens available in the email template, the attributes and references of an object are filled in automatically and correctly.

For a deep-dive look into using this module, check out this video:

1.1 Typical Use Cases

The typical usage scenario is sending emails with a template system and using tokens to handle all of your outgoing standard emails.

1.2 Dependencies

1.2.1 Mendix Modules

1.2.2 Java Libraries

  • commons-codec-1.14.jar
  • commons-email-1.4.0.jar
  • javax.mail-1.6.0.jar

2 Configuration

To configure this module, follow these steps:

  1. Download the Mx Model Reflection module from the Mendix Marketplace.
  2. Download and configure the Encryption module from the Mendix Marketplace.
  3. Add the Administration snippet to a custom page in a different module.
  4. View the example in the USE_ME > Examples folder.
  5. Create a duplicate of this example in your own module and customize it to make it fit your needs:
    • Sub_CreateAndQueueEmail – this is preferred for normal environments and will send the email in the background using a scheduled event
    • Sub_CreateAndSendEmail – this is preferred for Free App environments and sends an email directly; this approach will block the user’s flow and does not include a retry when the sending fails
    • Post-deployment – after deploying, you have to set up your email settings and insert your own email templates using the newly created navigation items under Administrator
  6. Go to MxObjects_Overview and synchronize the objects. Make sure you do this every time you have added new objects.

3 Read More