Send Email Template Using Deluge in Zoho CRM

[Zoho CRM] Send Email Template Using Deluge in Zoho CRM

How to send an email using an email template in a Deluge/Custom Function/Button?

This function is used to send email using Zoho CRM email templates. We would have to get the template id by going to the respective template and edit it. In the URL of the edit page, there is a long string of numbers. That is the template id. Please note that this function intends to send an email to the contacts module, but it is created in the deal module. Use case? for example, when a Deal is closed, we want to send an email to the contact. We can use it in workflow, blueprint, or even modify it slightly to be a button.

Also, "zcrm" is the connection name I am using. You can replace it with your own connection name that has the right permissions within Zoho CRM. 

  1. //define template id here. replace it with your own
  2. templateId = "2700842021110819999";
  3. //get the contact id from the deal record
  4. contactId = ifnull(zoho.crm.getRecordById("Deals",dealId).get("Contact_Name").get("id"),"");
  5. //get the email from the contact record
  6. contactEmail = ifnull(zoho.crm.getRecordById("Contacts",contactId).get("Email"),"");
  7. //send mail if email is not null
  8. if(contactEmail != "")
  9. {
  10. data = List();
  11. datainformation = Map();
  12. datainformation.put("from",{"email":"youremailhere@domain.com,"username":"your username here"});
  13. datainformation.put("to",{{"email":contactEmail}});
  14. datainformation.put("org_email",true);
  15. datainformation.put("template",{"id":templateId});
  16. data.add(datainformation);
  17. mapdata = Map();
  18. mapdata.put("data",data);
  19. sendSurvey = invokeurl
  20. [
  21. url :"https://www.zohoapis.com/crm/v5/Contacts/" + contactId.toString() + "/actions/send_mail"
  22. type :POST
  23. parameters:mapdata.toString()
  24. connection:"zcrm"
  25. ];
  26. info sendSurvey;
  27. }

Good luck!
    • Related Articles

    • [Zoho Accounts] How to Change to a New Email Address

      If you accepted an invitation to register a Zoho account using your personal email address and wish to change it to your specific business email address, you can do so by following the steps in this article.       1. Log in to ...
    • [Zoho CRM] How Do I Send An Email Automatically When A Lead Is Created?

      Workflow rules help you automate the process of sending an email to a lead as soon as they are added to CRM. Before you set up the workflow rule, you must create the email template. To do this: Navigate to Setup > Customization > Templates > Email. ...
    • [Zoho CRM] Cannot receive portal invite in CRM when using same domain email address

      Cannot receive portal invite in CRM when using same domain email address When the user tries to invite a contact to the customer portal with an email address sharing the same domain as the superadmin, the system will not allow it and throws this ...
    • [Zoho CRM] A Comprehensive Guide for Zoho CRM Wizards

      Unleashing the Power of Zoho CRM Wizards: A Comprehensive Guide What is CRM Wizards? Zoho CRM Wizards are a powerful tool designed to simplify and enhance the data entry process in Zoho CRM. They enable users to break down lengthy forms into a series ...
    • [Zoho CRM] Creating A Lead

      Leads in Zoho CRM can be created in several ways; Direct creation Import Social media connection (Facebook and Twitter) Zoho Mail integration Zoho Cliq (website ) integration To create directly, click on the '+' icon at the top right of the screen. ...