How can I send mail merge documents through email using Workflow rules?

How can I send mail merge documents through email using Workflow rules?

Yes, you can send documents created through mail merge via email using workflow rules with the help of functions. Read more about creating mail merge templates. 


To set workflow rule for sending mail merge documents
  1. Go to Setup > Automation > Workflow rule.

  2. Click +Create Rule.

  3. In Create New Rule, choose a module from the drop-down list.

  4. Enter Rule Name and Description.

  5. Click Next.

  6. In the Workflow configuration page, select When do you want to execute the rule?

  7. Choose a criteria, if you want the rule to execute for selected records.

  8. In Instant Action, choose Functions.

  9. In Configure Functions, select Write your own.

  10. Enter Function name and Display name.

  11. Click Edit Arguments.

  12. In the Edit Argument window, you can change the function name entered previously.

  13. In Argument Mapping, enter the record ID and email ID and map it with the right field.

    Use # to add a merge field.

  14. Click Save.

  15. Enter the below function.

resp = invokeurl 


 
[ 

               url :"https://zohoapis.com/crm/v2/settings/email_templates/653844000009571031/actions/print_preview?record_id=%22 + dealId 

 

type :GET 

 

connection:"mailmergeconnection" 


 ]; //Create connection and pass the required mail merge id here 


 content = resp.get("email_template_preview").get("body"); 

fmp = Map(); 


fmp.put("email",zoho.loginuserid); //Set the from address as needed 


 emaillist = List(); 

 

emp = Map(); 


emp.put("email",email); 


emaillist.add(emp); 


mp = Map(); 


mp.put("subject","Set as per your requirement"); 


mp.put("content",content); 


mp.put("to_address",emaillist); 


mp.put("id",dealId); 


mp.put("template_id","653844000009571011");//Pass the required template id here 


mp.put("from_address",fmp); 


mp.put("attachment_name","Deal Won Template");//Set the attachment name as needed 


datalist = List(); 


datalist.add(mp); 

paramp = Map(); 


paramp.put("data",datalist); 


resp1 = invokeurl 

 

[ 

 

 

type :POST 

 

parameters:paramp.toString() 

 

connection:"mailmergeconnection" 


 ]; 


 info resp1;

    • Related Articles

    • Managing Mail Merge Templates

      Mail merge is a function that helps you to simplify repetitive tasks to create personalized documents (Forms, Letters, Address Labels, Envelopes, etc.). You can create a mail merge template that would contain the variables (merge fields) in it. Using ...
    • Configuring Workflow Rules

      Workflow Rules in Zoho CRM, are a set of actions (email notifications, tasks and field updates) that are executed when certain specified conditions are met. These rules automate the process of sending email notifications, assigning tasks and updating ...
    • FAQs on Workflow Rules

      1. What is a workflow rule? Workflow rules in Zoho CRM are designed to enhance productivity and reduce manual work by automating routine activities in a business process. They allow you to create rules that can trigger associated action types to give ...
    • Converting Records Using Workflow Rules

      Converting leads, quotes or sales orders can be automated using workflow rules. When a record meets the criteria defined in the workflow rule, all the associated actions are triggered for the record. Workflow rules created for leads, quotes and sales ...
    • Formstack Documents

      Formstack Documents is an online document generation platform that lets you create documents of several types with dynamic content. You can send these document easily through the third party integrations provided. Formstack Documents lets you create ...