Forms: Routing email based on selected valueScenario
You have a Date Entry Form on a Table, and you wish to send (route) an email to a different recipient depending on a selection in the form.
The following example can be used as the basis for any other analogous selection situation.
Example
A doctor's office has an appointment request form that needs to be routed to different email addresses depending on the individual doctor chosen by the client.

Method
In addition to the Contact Form Table, a secondary Table is created listing the providers and their email addresses.

The Tables are linked with a Record Link connector on the Contact Form.

This provides the dropdown list in the Data Entry Form or Text Surface of the Table.
.png)
A Query is created joining the Provider field in the Contact Form with the Record Id in the Providers Table.
.png)
The Provider and Record Id fields are selected from the Contact Form Table and the Email field from the Providers Table.
Then in the Email Event on the Contact Form Table the email To: Field uses an embedded value based on the Query created above.
.png)
This dialog is accessed by clicking the Users button to the left of the (choose an embed option) dropdown at the upper right corner of the Email Editor.
.png)
Select the Query and be sure to select the 'Field to embed'. That yields the appropriate email address in the To: field of the email depending on the Provider selected by the user.
Set the Records Criteria to match.
.png)
Now depending on the Provider selected in the Contact Form the Event Email will be sent to the appropriate email address held in the Providers Table. |