You can automate your Writer's mail merge tasks by creating Workflow rules in your Zoho CRM. Say, for example, you want to automate the merge and send task for every lead entry in your Zoho CRM account (merge every lead entry send an email notification to that lead automatically using workflow rules). The zoho.writer.mergeAndSend task will supply values to the merge fields inserted to a document, and send these merged documents individually to the email ID specified.
You need a Zoho CRM account with manage workflow permission to create a workflow rule and associate it with a custom function.
Let's see the steps in detail:
Step 1: Create mail merge template in Zoho CRM
Before you get started, create a mail merge template with the required text and graphics. You can create mail merge templates in Zoho Writer and use CRM data (Leads, Accounts, Contacts, and Potentials) to create mail merge documents.
You can also create mail merge templates right inside Zoho CRM. Click
here for detailed steps.
Step 2: Create a workflow in Zoho CRM
Workflow Rules in Zoho CRM, are a set of actions including email notifications, and field updates that are executed when specific conditions are met. You can create a workflow rule and set an action to automate Writer's Mail Merge Tasks. (Merge and email, merge and download, merge and store, merge and sign, merge and invoke)
Click
here for detailed steps on how to create a workflow rule in Zoho CRM and associate custom function as an instant action.
Once you chose custom function as an instant action, do the following:
- You need to write a new custom function in the Deluge script editor and associate with the Workflow rule to automate Writer's mail merge tasks.
Choose "Write your own" option from the Configure Function pop-up.
- In the following Create new function pop-up, enter a function name, display name, and select the module to associate the custom function. Click Next.
- Now start writing your custom function in the Deluge script editor. Click here to find the steps to programming custom functions in the Deluge script editor.
Write your own custom function
You're creating a workflow rule to automate Writer's mail merge tasks including "Merge and Send", "Merge and Download", and "Merge and send for sign".
Click
here to know more about the available Writer tasks.
Merge and Send
Syntax
<response> = zoho.writer.v2.mergeAndSend(<document_id>, <merge_detail>, <output_settings>, <optional_settings>, <connection>);
Sample script
A sample script to "Merge and send" task is shown in the screen below:
Example
Automatically generate a personalized quote with a CRM record's data and send it as an email. You can even perform multiple actions like storing the generated quote in your desired folder in Zoho WorkDrive and attaching the quote to the CRM record.
Merge and Store
Syntax
<response> = zoho.writer.v2.mergeAndStore(<document_id>, <merge_detail>, <output_settings>, <optional_settings>, <connection>);
Sample Script
A sample script to "Merge and Store" ta
sk is shown in the screen below:
Example
Generate invoices with a CRM record's data and store it in the desired folder in Zoho WorkDrive. You can even perform multiple actions like sending the invoice via email and marking the status in the CRM record.
Merge and Sign
Syntax
<response> = zoho.writer.mergeAndSign(<document_id>, <merge_detail>, <filename>, <signerList>, <option_settings>, <connection>)
Sample Script
A sample script to perform the "Merge and Sign" task is shown in the screen below:
Example
Consider a scenario where a purchase order needs to be signed by multiple people. A sales rep can create a the purchase order with the CRM record's data and send it to sales managers for approval. You can also send the approved purchased order to the client via email.
Merge and Invoke
Syntax
<response> = zoho.writer.mergeAndInvoke(<document_id>, <merge_detail>, <optional_settings>, <connection>)
Sample Script
A sample script to perform the "Merge and Invoke" task is shown in the screen below:
Example
You can merge a deal agreement with your client's details from CRM and send it for signing. And once it is signed, you can invoke a custom function to save a copy of the agreement as an attachment to the CRM record.