Send emails containing contextual download links

Send emails to users containing download links contextual to products or services they showed interest in on the contact form.

When users submit a contact form on a business's website, they often receive an acknowledgement email. Some businesses go the extra mile and include links to PDFs or other downloadable resources in this email. These resources can help users gain a better understanding of the products and make informed decisions when making a purchase. However, what if you want to include download links contextual to products or services users showed interest in? For example, when a user checks the television option, you want to share a link to the brochure containing recent launches in the email.

Well, our low-code tools enable you to do just that. You can create a custom function that will automatically add contextual download links in the email based on the checkboxes selected by the user. Once created, link it up with a workflow rule that auto-sends emails to users who submit the form.

Permissions and availability

  • Users with the Modules Customization permission can add custom fields.
  • Users with the Manage Automation permission can create and update workflow rules.
  • Users with the Manage Extensibility permission can write custom functions.
  • Users with the Manage Sandbox permission can manage the sandbox.

Requirements

  • Add the required checkbox fields in the Contacts module. The checkbox fields will offer different interest options that must be captured from the contact form. Learn more
  • Create a workflow rule that sends an automated email to users submitting the form on your website. Learn more
  • Write a custom Deluge function to be linked with the workflow rule. Learn more
  • Test the workflow rule in a sandbox before deploying it in your production environment. Learn more

Create a new function

  1. Navigate to Setup > Automation > Actions > Functions > Configure Function > Write your own.
  2. Provide a name for the function (without spaces). For example: "Sendemailwithlinks".
  3. Enter a display name.
  4. Set the module as Contacts from the dropdown list, and then click Create.
  5. On the Deluge Script Editor, copy and paste the code given below.
  6. Make the necessary changes in the code snippet.
  7. Click Edit Arguments and do the following:
    1. Choose Contacts - Contact Id and name it contId.
    2. Click the + icon to map more arguments.
    3. Choose Contacts - Email and name it email.
    4. Click Save.
  8. Click Save on the editor page.

Associate this function with a workflow rule to automate emailing users whenever they submit the form.

Create Function

The code

Code Copied
resp = zoho.crm.getRecordById("Contacts",contId);
link = "";
c1 = resp.get("Television");
c2 = resp.get("Soundbar");
c3 = resp.get("Home Theatre");
c4 = resp.get("Refrigerator");
c5 = resp.get("Oven");
c6 = resp.get("Cooktop");
c7 = resp.get("Air Fryer");
c8 = resp.get("Air Conditioner");
c9 = resp.get("Dish Washer");
c10 = resp.get("Washing Machine");
if(c1 == true)
{
	link = link + "https://workdrive1.zylker.com" + ",";
}
if(c2 == true)
{
	link = link + "https://workdrive2.zylker.com" + ",";
}
if(c3 == true)
{
	link = link + "https://workdrive3.zylker.com" + ",";
}
if(c4 == true)
{
	link = link + "https://workdrive4.zylker.com" + ",";
}
if(c5 == true)
{
	link = link + "https://workdrive5.zylker.com" + ",";
}
if(c6 == true)
{
	link = link + "https://workdrive6.zylker.com" + ",";
}
if(c7 == true)
{
	link = link + "https://workdrive7.zylker.com" + ",";
}
if(c8 == true)
{
	link = link + "https://workdrive8.zylker.com" + ",";
}
if(c9 == true)
{
	link = link + "https://workdrive9.zylker.com" + ",";
}
if(c10 == true)
{
	link = link + "https://workdrive10.zylker.com" + ",";
}
sendmail
[
	from :zoho.adminuserid
	to :email
	subject :"enter subject"
	message :"enter message" + link.removeLastOccurence(",")
]

Notes

  • This code snippet can accommodate a maximum of 10 checkbox fields. You may add or delete them as per your needs.
  • Use the accurate API names for their corresponding fields in the code snippet. For example, replace the names of checkbox fields like "Television" and "Soundbar" with the related API names from your CRM. Learn more
  • Replace the existing links in the code snippet with the correct download links for the corresponding checkboxes.
  • Enter a suitable subject and message to be sent to users.
  • The email will be sent using the email address of the CRM application owner.
  • The above code is an example of sending an email to contact records. By changing the module name and parameters, you can use this code to send emails with contextual links for any other module.

Tip

  • Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.

Test the solution

  1. Go to the contact form on your website.
  2. Select one or more checkboxes in the form and submit it to create a new contact record in your CRM.
    The workflow rule will get triggered upon contact creation.
  3. Check whether you received an email with download links corresponding to the checkboxes you selected.

Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.

More info

  • ModuleContacts
  • Trigger PointWorkflow Rule
  • EditionEnterprise and above
  • ComplexityHigh
  • Implementation Time60 minutes

Features used in the solution

Custom FieldWorkflow RuleDeluge ScriptSandbox
Story Image

Looking for a custom solution?

Contact us, we will help enhance your productivity at lightning speed.

SUBMIT REQUEST

Developers: Share your solution with our community!