我可以从gmail附件中打开日历吗

时间:2019-01-30 10:13:09

标签: google-calendar-api gmail-addons

我想通过我的自定义gmail插件在日历中创建一个事件。而且我需要将标题,说明传递给Calendar gmail附加组件或Google日历。

有可能吗?

期望功能的图片:

This is the picture of expecting feature

2 个答案:

答案 0 :(得分:0)

您是否考虑过使用Google Calendar API?您可以使用它来创建日历事件。

除此之外,您将需要操作DOM ...并不容易/稳定。

答案 1 :(得分:0)

您可以使用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());

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可让您在用户界面中打开日历事件。

和的最后一个选项是使用创建要事件模板形式预先填充如所描述的here