Skip to main content

Email Rules

Email rules determine when specific email types are triggered. For example, if you want a new user to receive a welcome email upon signing up, you would create an email rule to automate this process.

To access the Email Rules interface, navigate to Email Rules in the left-hand menu. Click on it to open the Email Rules page. To create a new email rule, click the '+' button in the top-right corner of the page.

Empty Email Rule

Configuring an Email Rule

  1. Naming the rule – Provide a clear and descriptive name.
  2. Defining the trigger operations – Specify the actions that will trigger the rule.
    1. Specify the applicable database operations such as insert, update, delete, or upload.
  3. Selecting the target table – Choose the database table that will activate the email template.
    1. Define the table to which the rule applies. When a mutation occurs on the specified table, the corresponding email will be sent.
  4. Assigning an email template – Enter the email template to be used when the rule is triggered.
    1. The selected email type must be pre-configured.
  5. Specifying the role name – Define the role name of the user who will execute the query.
    1. Ensure that the role has the proper permissions for that table see Policy Rules for more details.

Once configured, save the rule to enable automated email notifications based on the specified conditions.

Example

In the email rule below, when a new user is inserted into the devii_users table, the rule is triggered. The 'Nobody' role configured with select permissions on the devii_users table, so it can retrieve the newly inserted user upon sign-up.

Email Rule Example