0

I want create an event in calendar from my custom gmail add-on. And I need to pass Title, Description to Calendar gmail add-on or google calendar.

Is it possible?

Picture of expecting feature:

This is the picture of expecting feature

Raduan Santos
  • 1,023
  • 1
  • 21
  • 45
Freddy Daniel
  • 602
  • 11
  • 25

2 Answers2

0

Have you thought about using the Google Calendar API? You could use this to create the Calendar Event.

Other than that you will be needing to manipulate the DOM... not easy/stable.

PNC
  • 1,932
  • 19
  • 36
  • I don't need to manipulate DOM. I want something like this `calendarApp.open({title:'myTitle', details:'Description passed from my gmail addon'})` – Freddy Daniel Jan 31 '19 at 09:30
0

You can either use the CalendarApp:

var event = CalendarApp.getDefaultCalendar().createEvent('Apollo 11 Landing',
    new Date('July 20, 1969 20:00:00 UTC'),
    new Date('July 21, 1969 21:00:00 UTC'));
Logger.log('Event ID: ' + event.getId());

or Advanced Calendar Service:

function createEvent() {
  var calendarId = 'primary';
  var start = getRelativeDate(1, 12);
  var end = getRelativeDate(1, 13);
  var event = {
    summary: 'Lunch Meeting',
    location: 'The Deli',
    description: 'To discuss our plans for the presentation next week.',
    start: {
      dateTime: start.toISOString()
    },
    end: {
      dateTime: end.toISOString()
    }
  };
  event = Calendar.Events.insert(event, calendarId);
  Logger.log('Event ID: ' + event.id + ' Event link in Calendar: ' + event. htmlLink);
}

event.htmlLink lets you open the Calendar event in the UI.

And the last option is to use the create event template form which you pre-populate as described here.

luc
  • 3,642
  • 1
  • 18
  • 21