Hack: Fixing broken email with Zoho CRM-ShowTime integration

Hack: Fixing broken email with Zoho CRM-ShowTime integration

I'm running a bunch of online learning sessions in Zoho ShowTime, for which I need to send follow-up emails when someone attends/finishes a quiz/signs up but doesn't attend. As those of you who do this (I'm sure I'm not the only one...) know, if you try and open up the ShowTime attendee record in ZCRM, sending an email errors out. While I "kindly wait for [Zoho's] development team to look into this", as the support folks always say, I've come up with a good workaround that gets the job done pretty well. Now that I've done Zoho's job for them, I'd love it if they just implemented it right, but if you're as frustrated with this as I am, here's how to fix it in your ZCRM instance so you can filter/bulk email participants like a good online training system should let you do.


1. in ZCRM, go to Setup > Modules and Fields > Zoho ShowTime. Edit the standard layout, and add the missing standard Email field from Unused Fields. Save it.
2. Go to Setup > Workflow Rules > Create Rule. Create a rule for Zoho ShowTime called "Fix Stupid Email Bug". Run the rule for all created/edited Zoho ShowTimes, with no conditions.
3. Create a function. As the 'showtime' argument, pass the value of Zoho ShowTime - Zoho ShowTime Id.
4. Copy-paste the following chunk of Deluge into the function body:

stAttendee = zoho.crm.getRecordById("zohoshowtime__Zoho_ShowTime",showtime);
stAttendee.put("Email",stAttendee.get("zohoshowtime__Email_Id"));
stAttendee.put("Name",stAttendee.get("zohoshowtime__First_Name") + " " + stAttendee.get("zohoshowtime__Last_Name"));
zoho.crm.updateRecord("zohoshowtime__Zoho_ShowTime",showtime,stAttendee);

5. Save the whole thing. That's going to fix it for records going forward. It will also set the Name correctly so that when you send an email, they get the name they entered as the To: field, rather than the internal name of your course. Now, to fix existing stuff:
6. Go to Setup > ShowTime Sessions > Links and Buttons. Create a new button called 'Fix Emails'.
7. Create a new function with the "showtime" argument map set to ShowTime Sessions - ShowTime Sessions Id.
8. Copy-paste the following chunk of Deluge as the function body:

rl_attendees = zoho.crm.getRelatedRecords("People","zohoshowtime__ShowTime_Sessions",showtime);
for each  stAttendee in rl_attendees
{
stAttendee.put("Email",stAttendee.get("zohoshowtime__Email_Id"));
stAttendee.put("Name",stAttendee.get("zohoshowtime__First_Name") + " " + stAttendee.get("zohoshowtime__Last_Name"));
zoho.crm.updateRecord("zohoshowtime__Zoho_ShowTime",stAttendee.get("id"),stAttendee);
}
return "";

9. Save everything off. Now, go into each of your ShowTime sessions and run this.
10. Voila! Bug fixed. You can now send individual or bulk emails to your ShowTime attendees in ZCRM.

Now, if there was only a good way in ShowTime to automate the "push to CRM" button for all sessions, I'd be even happier because then I could automate the whole thing, rather than having to check in Showtime and do this manually every couple of days because there's no way to put a trigger on quiz completion. But that's another bug for another day...