Apex · Email Markup · Email Service · Email Services · Integration · Salesforce

Creating Google Calendar Events from Salesforce Without Integration

Hi All,

This blog helps you to create Google calendar events from Salesforce without any integration. Why to create Google Calendar events?

For Example: In your organization HR is sending emails to the interviewers to take interviews. The interviewers may forget on the interview day for taking the interview on time. So to overcome these type of problem we can create google calendar events on the interviewer google calendar so the interviewer will get the remainder of interview on time.

To create google calendar events from Salesforce there are mainly two ways the first process is using integration but using the integration we need to know there google username and password or using Oath Authentication and this process is pretty hard. So the second process is using Google Email Markup and create google calendar events.

What is Google Email Markup?  Email markup uses structured data in emails to work. Inbox and Gmail support both JSON-LD and Microdata and you can use either of them to markup information in email. This lets Google understand the fields and provide the user with relevant search results, actions like creating google calendar events.

To know more about Email Markup visit this link: https://developers.google.com/gmail/markup/getting-started#your_first_markup

Creation of Email Markup:

First Create an HTML email message. HTML Email message example is given below.

<html>
<body>
Dear John, You have an interview Scheduled for First Round in ABC Company.

INTERVIEW DETAILS
Name: John Max
Event: 1st Round Interview
When: May 6th 2016 8:30am PST
Venue: ATT Park 24, Willie Mays Plaza, San Francisco, CA 94107 US
</body>
</html>

 

This HTML email needs to be converted to email markup. To convert HTML email to markup there is a tool named ‘Structured data markup helper‘. To open that tool click on this link: https://www.google.com/webmasters/markup-helper/u/0/?email=true

The image of Structured data markup helper is given below.

Structured Mark Up

Paste the above HTML code in the text area ‘Paste HTML here’. Select any data type of markup here i am selecting ‘Event Reservations’ from the radio buttons. Click on ‘Start Tagging’ button on the bottom section of text area. The page will be navigated to next stage.

Tag data page

The next page will be displayed on the above image. Here on the left side of the image is the HTML email message and on the right side of the image is event parameters. So we need to match the event parameters to the email message. Double click on any word in HTML email message the a picklist will be opened there we can select any event parameter and map the parameter to that word.

Untitled

Here the ‘Interview Scheduled for First Round’ is mapped with event name. So we need to map HTML Email message with the parameters once email message is mapped with the parameters then click on ‘Create HTML’ button on the top right corner then page will be navigated to third stage.

Third Page

In the right side of the above image indicates the email markup of the HTML email message. To validate the Email Markup there is a tool available in the market. To open this tool click on this link: https://www.google.com/webmasters/markup-tester/u/0/

Paste the HTML Email Message and Markup in the text area and click on ‘Validate’ button if you get ‘No errors detected’ then your markup is good to go.

emailmarker

Paste the HTML Email Message and Markup in the Custom Email Template in Salesforce.

Create Custom Email Template:

To create custom email template click on Setup-> Communication Templates-> Email Templates-> Click on New Template-> select Custom (without using letterhead) and click on next paste the HTML and email markup. Click on Save.

<html>
<script type="application/ld+json"
 {
  "@context": "http://schema.org",
  "@type": "Event",
  "name": "1st Round Interview Scheduled",
  "startDate": "2016-05-18T15:30:00Z",
  "endDate": "2016-05-18T16:30:00Z",
  "location": {
  "type": "Place",
  "address": {
  "@type": "PostalAddress",
  "name": "John Max",
  "streetAddress": "24 Willie Mays Plaza",
  "addressLocality": "San Francisco",
  "addressRegion": "CA",
  "postalCode": "94107",
  "addressCountry": "USA"
   }
 },
 "potentialAction": [
 {
 "@type": "RsvpAction",
 "handler": {
 "@type": "HttpActionHandler",
 "url": "https://ap2.salesforce.com/home/rsvp?eventId=123&value=yes"
 },
 "attendance": "http://schema.org/RsvpAttendance/Yes"
  },
 {
 "@type": "RsvpAction",
 "handler": {
 "@type":"HttpActionHandler",
 "url": "https://ap2.salesforce.com/home/rsvp?eventId=123&value=no"
 },
 "attendance": "http://schema.org/RsvpAttendance/No"
  },
  {
 "@type": "RsvpAction",
 "handler": {
 "@type": "HttpActionHandler",
 "url": "https://ap2.salesforce.com/home/rsvp?eventId=123&value=maybe"
 },
 "attendance": "http://schema.org/RsvpAttendance/Maybe"
 }
 ]
 }
 </script>

<body>
 Dear John, You have an interview Scheduled for First Round in ABC Company.

INTERVIEW DETAILS
Name: John Max
Event: 1st Round Interview
When: May 6th 2016 8:30am PST
Venue: ATT Park 24, Willie Mays Plaza, San Francisco, CA 94107 US
</body>
</html>

This email template will work if our Salesforce org is registered in google. For registering with google use this link: https://docs.google.com/a/cloudalyze.com/forms/d/1PA-vjjk3yJF7MLPOVKbIz3MBfhyma2obS8NIZ0JYx8I/viewform?pli=1

But for testing the email markup we can use a tool. The link for the tool is: http://gmail-actions.appspot.com/

tester

Note: The logged in and sending email must be the same email address.

On clicking ‘Send Email’ button then an email will be send to your sending email address.

The Email message will be looking like this in the below image.

email.png

On clicking Yes button a google calendar event will be created. We can create google calendar events from Salesforce without using any integration.

Please post your comments or inputs if you feel this blog is helpful.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s