Many websites have forms like this one on their website. Using the "Custom Form Processing" functionality, you can direct the submitted form data you receive to different email addresses. For example, all submitted forms that include "Ukraine" from the "Country" dropdown can be sent to one email address. And all forms that include "Canada" can be directed to another email address.
To configure this functionality, log into the Operations Portal and type "CMS" in the main navigation's search bar.
Click "Pages" to view the grid with all of your website's CMS pages.
For example purposes, we will walk through how to configure this functionality for the "Contact Us" form that was referenced earlier, but you can apply the following steps to any form on your website. Next, search for the page where the form is located. In this case, we will search "contact us".
Click the "Edit" icon to open the page editor.
Click anywhere on the "Country" block to edit the block's properties.
Click the "Block" tab on the settings panel.
Give the "Country" block a name by adding a keyword to the "Select name" text box. In this case, we will type "countries".
Save the changes to the page by clicking the "Save" button.
Head back to the Operations Portal navigation and type "API".
Click "API Scripts" to access the screen with all of your system's API scripts.
Locate the script titled "processCustomerForm.js".
Click the script's "Details" button to access the script page.
Find the "toEmails" variable in the script.
To signal to your system what form value should determine where the form emails are sent and what email address you want to receive these emails, add the code displayed on the screen.
Add the name you gave your CMS block earlier. In this example, we named our block, "countries".
Replace 'Ukraine' with a country on your form, or another value of your choosing. Make sure to leave the single quotes and place your value inside the quotes.
Replace this email address with the one you want to receive the form submissions based on the value you set in the last step.
To tie another form value to a different email address, add the "else if" code to your script immediately below the code you previously added.
Replace "countries" with the name of your CMS block.
Replace "Canada" with a different value from your form.
Replace this email address with the one you want to receive the form submissions based on the value you just set.
You can repeat the "else if" code as many times as needed to assign form values to specific email addresses.
Save the changes to you script by clicking the "Save" button.
To test the new form processing you just enabled, head to the page where your form is located on your company's website. In this example, our form is located on the "Contact Us" page.
To create a test, fill out the form in its entirety using a test persona. In this example, our hypothetical user, James, selected "Ukraine" as his country.
Click the "Submit" button to send the form.
Fill out a second form using a different test persona to submit two tests for good measure. In this example, our hypothetical user, Cindy, selected "Canada" as her country.
Click the "Submit" button to send the form.
Once your two test forms are sent, head back to the Operations Portal and search "Emails" in the main navigation search bar.
Click "Emails" to access a page with all your system's emails.
To ensure your spreadsheet displays the most recently sent emails at the top, sort the "Sent" column by clicking on the "Arrow" icon next to the word "Sent".
Your two test form emails should be listed at the top of the spreadsheet.
To view a copy of the email that was sent, click on the "Preview" icon in its row.
A preview of the email that contains the contents of the form will appear. You can compare this email with the information you used to fill out the test form to ensure your test was successful. You can do this for all the test forms you filled out.