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, but go to the correct recipient(s) once the form is in production.
This method is best suited for when you want to allow form testers to enter their own email addresses. With this method, the production email addresses are hard-coded, but when the form is being used in the Test environment, it will dynamically request the user to enter a testing email.
For a simpler alternative method that uses form builder-defined email addresses for testing, see the page Set Email Recipients Based on Form Environment Using Emails Defined by Form Builder.
In this article:
- Creating a Logic to Determine Current Environment (Test or Production)
- Creating a Prefilled Hidden Field
- Creating a Conditional Section Based on Form Environment
- Creating a Logic to Switch Emails Based on Environment
- Adding Logic to Email Template
Creating a Logic to Determine Current Environment (Test or Production)
- Under the Logic tab, add a new Logic to the form.
- Choose the Type Predefined.
- Select UMN - Jadu - Current Environment from the Formula drop down list.

- Give the logic a user-friendly name and select the Save button.
Creating a Prefilled Hidden Field
Next you will create a Hidden Field on your page and prefill it with the output from the current environment logic created above. This will be used to conditionally show or hide an email address field to the form submitter based on the current environment.
- In the page editor, add a Hidden Field component to the page.
- In the Hidden Field pop up window, give the component a user-friendly name.

- Select the Add Component button (leave the Value field empty).
- Exit the page editor by selecting the Return to Form Structure button.
- Under the Prefills tab, add a new prefill for the hidden field.
- In the Prefill pop up window, select the following options from the drop down lists:
- I want to prefill - select the Hidden Field you created above
- With the value of - select the Predefined Logic you created above

- Select the Save button.
Creating a Conditional Section Based on Form Environment
Now you will create a section on your page that only shows up when the form is being filled in the Test environment. The section will have a question where the form user can enter the email address(es) that they want the test email to go to.
- Return to the page editor and add a new Section element to the page.
- Give the section element a user-friendly title
- In the New Section configuration pane, select the following options:
- Show section - click the Conditionally button
- Show when - select Comparison of (a new selection box will appear below)
- Choose your Hidden Field (a new selection box will appear below)
- Select is not equal to (a new text entry box will appear below)
- Type PRD in the final field

- Click the Add Section button.
- Add a new Text Field element to the section you just created. Be sure to drag the element inside the Section.
- Enter user-friendly question text requesting the testing email address(es) in the Text Field.
- Consider adding Help text with formatting for multiple emails (comma-separated with no spaces).
- Then click the Add Question button.
- Exit the page editor by clicking the Return to Form Structure button.
Creating a Logic to Switch Emails Based on Environment
Finally, you will add a Conditional Logic that will automatically switch the email recipients depending on the environment. It will use hard-coded email addresses for the Production environment, but will take the user-supplied email addresses when in the Test environment.
- Under the Logic tab, add a new Logic to the form.
- Give the logic a user-friendly title.
- Choose the Type Conditional and then build out the conditional formula as below.
- If environment is Production, Then Return {Production Email}; Else Return {Response to Email Question}
- In the If statement box, select the Predefined Logic you created above in the first field. Select is equal to in the second field. Finally, type PRD in the last field.
- In the Return box, enter the production email address(es). This is where the email will be sent when the form is in the Production environment.
- In the Else Return box, enter the Text Field question you created above. This is where the user will enter their testing email addresses to send to.

- If environment is Production, Then Return {Production Email}; Else Return {Response to Email Question}
- Click the Save button.
Adding Logic to Email Template
To use the Logic created above to switch the recipients of an email template based on the environment, follow the steps below
- Open your existing action email template or create a new one.
- Click the # Variable button next to the To field in the email template.

- 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.

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

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).