Jadu Forms: Set Email Recipients by Environment Using Emails Defined by Form Builder

It's useful to make sure that emails generated by a form go to an appropriate test account during the testing phase of building a form, and go to the correct recipient(s) once the form is in production.

This method is best suited for when you have a test email address that won't change. With this method, the test and production email addresses are hard-coded, so updating the email recipients requires editing the Conditional Logic.

For an alternative method that allows the form submitter to enter their email address for testing, see the page Set Email Recipients by Environment Using Emails Chosen by Form Submitter.

In this article:

Creating a Logic to Determine Current Environment (Test or Production)

  1. Under the Logic tab, add a new Logic to the form. 
  2. Choose the Type Predefined.
  3. Select UMN - Jadu - Current Environment from the Formula drop down list.

Jadu New Logic window with Predefined type selected and UMN - Jadu - Current Environment chosen in Formula dropdown.

  1. Give the logic a user-friendly name (ex: "Current Env") and select the Save button.

Creating a Logic to Switch Emails Based on Environment

  1. Add another Logic to the form.
  2. Choose the Type Conditional.
  3. Build out the conditional formula with these settings:
    1. In the If statement box, select the Predefined Logic you created above in the first step
    2. In the Return statement box, type the email address(s) that should receive the email when this form is being submitted in the Production environment.
    3. In the Else Return statement, type the email address(s) that should receive the email when this form is being tested in the Form Building environment.

Note: Multiple email addresses should be comma-separated, e.g., [email protected], [email protected]

Jadu New Logic window with Logic name “Approval Email recipient”, Conditional type with Formula section containing IF statement, RETURN statement for production email, and ELSE RETURN statement for test email

  1. Give the logic a user-friendly name and select the Save button.

Adding the Logic to Your Email Template

To use the logics created above to switch the recipients of an email template based on the environment, follow the steps below.

  1. Open your existing action email template or create a new one.
  2. Click the # Variable button next to the To field in the email template.

Jadu New Action Template window with Email to Approver title and # Variable button next to the To field highlighted

  1. In the Insert Variable pop up window, click on the Logic tab and then click Insert next to the Conditional Logic that you created above.

Insert Variable pop up window on Logic tab displaying the Logic name Approval Email recipient with Insert option highlighted.

  1. You should now see your Conditional Logic inserted as a variable in the To field of the email template.

Jadu New Action Template window with To field populated with Logic Approval Email recipient

  1. Complete the rest of your email template as required and then click the Save button.


Your email template is now ready to be used in a rule. Now every time the email template is triggered by a rule, Jadu will first check to see what environment the form is in and then send the email to the correct recipient(s)

Last modified

Changed

TDX ID

TDX ID
7827