Send an Email with Zoho CRM API
Benefits:-
1. Using this API We can log the Email Record with the respective module.
2. We can track the email status.
3. We can Apply the workflow on this email according to their status like (Open, Click, Sent)
Deluge Code…….
- finallist = List();
- frommp = Map();
- frommp.put("email", zoho.adminuserid);
- mp = Map();
- mp.put("from", frommp);
- tomaplist = List();
- tomap = Map();
- tomap.put("email", "zohodeveloper456@yopmail.com");
- tomaplist.add(tomap);
- //…….Multiple Receiver………
- tomap1 = Map();
- tomap1 .put("email", "Second_User_Email");
- tomaplist.add(tomap1 );
- mp.put("to", tomaplist);
- //..........Get Template Data............
- TemplateID = "4655606000009017348";
- templatemap = Map();
- templatemap.put("id", TemplateID);
- mp.put("template", templatemap);
- finallist.add(mp);
- finalmap = Map();
- finalmap.put("data", finallist);
- //..........Send Email Zoho CRM API......
- Lead_ID = "4655606000009014003";
- SendEmail = invokeurl
- [
- url: "https://www.zohoapis.com/crm/v5/Leads/"+Lead_ID+"/actions/send_mail"
- type: POST
- parameters: finalmap.toString()
- connection:"zcrm"
- ];
- info SendEmail;
Scope will be:- ZohoCRM.send_mail.{module_name}.CREATE
(or) scope=ZohoCRM.send_mail.all.CREATE
Output on Successful Response:-
{"data":[{"code":"SUCCESS","details":{"message_id":"0f9b4cb4b57ed85e6cd184d34a57da934e3c884f3f175bdd64f89291e16ec348"},"message":"Your mail has been sent successfully.","status":"success"}]}
Attach with CRM Record
Multiple Receipt Email Sample
Zoho CRM API Reference Document:-
https://www.zoho.com/crm/developer/docs/api/v5/send-mail.html
Thanks & Regards
Piyush Goyal
Zoho Developer || 3+ years Experience
+91-8619164837