Created
October 12, 2021 04:28
-
-
Save jeznag/c0ab5a25d35bb7069872204df6aba4ec to your computer and use it in GitHub Desktop.
Send templated emails from Zoho CRM using deluge script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config_map = configuration.toMap(); | |
| template_id = config_map.get("template_id"); | |
| to_email = config_map.get("to_email"); | |
| subject = config_map.get("subject"); | |
| from_name = config_map.get("from_name"); | |
| from_email = config_map.get("from_email"); | |
| module_name = config_map.get("module_name"); | |
| record_id = config_map.get("record_id"); | |
| org_email_address = config_map.get("org_email_address"); | |
| template_data = {"id":template_id}; | |
| email_payload = {"data":{{"from":{"user_name":from_name,"email":from_email},"to":{{"email":to_email}},"org_email": org_email_address,"subject":subject,"mail_format":"html","template":template_data}}}; | |
| send_mail_resp = invokeurl | |
| [ | |
| url :"https://www.zohoapis.com/crm/v2.1/" + module_name + "/" + record_id + "/actions/send_mail" | |
| type :POST | |
| parameters:email_payload.toString() | |
| connection:"crm_emails" | |
| ]; | |
| return send_mail_resp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| standalone.send_email_via_zoho_api({"template_id":803228000047145582,"to_email":email,"subject":null,"from_name":"My Special Org","from_email":"[email protected]","module_name":"Leads","record_id":lead_id,"org_email_address":true}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment