How do I send the standard invitation email when calling addGuest on a CalendarEvent?
Whenever I add a guest via the Google Calendar UI, the following dialog pops up:
If I choose "Send" it sends a nicely formatted email to the user with an option to respond to the calendar event too. This works great when you're using the Google Calendar UI.
Problem is I'm trying to use Google Apps Scripts to automate adding people to events.
I'm programmatically adding guests to a CalendarEvent by using addGuest():
event.addGuest("user@example.com");
However, there doesn't seem to be an option to send an email.
The closest I could find is that when you programmatically create an event, you can set sendInvites
:
var event = CalendarApp.getDefaultCalendar().createEvent('Apollo 11 Landing',
new Date('July 20, 1969 20:00:00 UTC'),
new Date('July 20, 1969 21:00:00 UTC'),
{sendInvites: true});
Update: Even with this option enabled, it isn't sending out invite emails.
The problem with this is I don't see how to set this property on an event that already exists. It only looks like it'll work on a newly created event. In fact, I don't see a way to even read this property on an event. So seemingly, the only way I can know if addGuest
will send an invite is to try adding a guest, and then ask that person if they got an email.
Is there any way to do any of the following:
Choose to send an invite when calling
addGuest
?
e.g.
event.addGuest("user@example.com", {sendInvite: true})
Change thesendInvites
property on aCalendarEvent
?
e.g.
event.setOptions({sendInvites: true})
- Any other workaround that will produce the same email that is sent when hitting that "Send" button in the UI above?
Update:
- I just saw getAllTagKeys in the API and was hoping I could use that to get the
sendInvites
key, but that's not the case. It is empty even for events that havesendInvites
set to true. - I just tried calling
addGuest
on a newly created event that hassendInvites: true
, but that didn't send an email. - The problem with using MailApp to send an email is that it won't be nicely formatted like the one Google automatically sends out (e.g. with embedded calendar invite, attendees, description, response links, etc, etc, etc).
google-apps-script google-calendar-api
add a comment |
Whenever I add a guest via the Google Calendar UI, the following dialog pops up:
If I choose "Send" it sends a nicely formatted email to the user with an option to respond to the calendar event too. This works great when you're using the Google Calendar UI.
Problem is I'm trying to use Google Apps Scripts to automate adding people to events.
I'm programmatically adding guests to a CalendarEvent by using addGuest():
event.addGuest("user@example.com");
However, there doesn't seem to be an option to send an email.
The closest I could find is that when you programmatically create an event, you can set sendInvites
:
var event = CalendarApp.getDefaultCalendar().createEvent('Apollo 11 Landing',
new Date('July 20, 1969 20:00:00 UTC'),
new Date('July 20, 1969 21:00:00 UTC'),
{sendInvites: true});
Update: Even with this option enabled, it isn't sending out invite emails.
The problem with this is I don't see how to set this property on an event that already exists. It only looks like it'll work on a newly created event. In fact, I don't see a way to even read this property on an event. So seemingly, the only way I can know if addGuest
will send an invite is to try adding a guest, and then ask that person if they got an email.
Is there any way to do any of the following:
Choose to send an invite when calling
addGuest
?
e.g.
event.addGuest("user@example.com", {sendInvite: true})
Change thesendInvites
property on aCalendarEvent
?
e.g.
event.setOptions({sendInvites: true})
- Any other workaround that will produce the same email that is sent when hitting that "Send" button in the UI above?
Update:
- I just saw getAllTagKeys in the API and was hoping I could use that to get the
sendInvites
key, but that's not the case. It is empty even for events that havesendInvites
set to true. - I just tried calling
addGuest
on a newly created event that hassendInvites: true
, but that didn't send an email. - The problem with using MailApp to send an email is that it won't be nicely formatted like the one Google automatically sends out (e.g. with embedded calendar invite, attendees, description, response links, etc, etc, etc).
google-apps-script google-calendar-api
If it isn't done automatically, you will need to send it yourself withMailApp
– tehhowch
Jan 1 at 4:23
Reviewing the advanced service (Calendar rest API) indicates the email will be sent automatically (at least when using the rest API directly) developers.google.com/calendar/concepts/…
– tehhowch
Jan 1 at 4:38
add a comment |
Whenever I add a guest via the Google Calendar UI, the following dialog pops up:
If I choose "Send" it sends a nicely formatted email to the user with an option to respond to the calendar event too. This works great when you're using the Google Calendar UI.
Problem is I'm trying to use Google Apps Scripts to automate adding people to events.
I'm programmatically adding guests to a CalendarEvent by using addGuest():
event.addGuest("user@example.com");
However, there doesn't seem to be an option to send an email.
The closest I could find is that when you programmatically create an event, you can set sendInvites
:
var event = CalendarApp.getDefaultCalendar().createEvent('Apollo 11 Landing',
new Date('July 20, 1969 20:00:00 UTC'),
new Date('July 20, 1969 21:00:00 UTC'),
{sendInvites: true});
Update: Even with this option enabled, it isn't sending out invite emails.
The problem with this is I don't see how to set this property on an event that already exists. It only looks like it'll work on a newly created event. In fact, I don't see a way to even read this property on an event. So seemingly, the only way I can know if addGuest
will send an invite is to try adding a guest, and then ask that person if they got an email.
Is there any way to do any of the following:
Choose to send an invite when calling
addGuest
?
e.g.
event.addGuest("user@example.com", {sendInvite: true})
Change thesendInvites
property on aCalendarEvent
?
e.g.
event.setOptions({sendInvites: true})
- Any other workaround that will produce the same email that is sent when hitting that "Send" button in the UI above?
Update:
- I just saw getAllTagKeys in the API and was hoping I could use that to get the
sendInvites
key, but that's not the case. It is empty even for events that havesendInvites
set to true. - I just tried calling
addGuest
on a newly created event that hassendInvites: true
, but that didn't send an email. - The problem with using MailApp to send an email is that it won't be nicely formatted like the one Google automatically sends out (e.g. with embedded calendar invite, attendees, description, response links, etc, etc, etc).
google-apps-script google-calendar-api
Whenever I add a guest via the Google Calendar UI, the following dialog pops up:
If I choose "Send" it sends a nicely formatted email to the user with an option to respond to the calendar event too. This works great when you're using the Google Calendar UI.
Problem is I'm trying to use Google Apps Scripts to automate adding people to events.
I'm programmatically adding guests to a CalendarEvent by using addGuest():
event.addGuest("user@example.com");
However, there doesn't seem to be an option to send an email.
The closest I could find is that when you programmatically create an event, you can set sendInvites
:
var event = CalendarApp.getDefaultCalendar().createEvent('Apollo 11 Landing',
new Date('July 20, 1969 20:00:00 UTC'),
new Date('July 20, 1969 21:00:00 UTC'),
{sendInvites: true});
Update: Even with this option enabled, it isn't sending out invite emails.
The problem with this is I don't see how to set this property on an event that already exists. It only looks like it'll work on a newly created event. In fact, I don't see a way to even read this property on an event. So seemingly, the only way I can know if addGuest
will send an invite is to try adding a guest, and then ask that person if they got an email.
Is there any way to do any of the following:
Choose to send an invite when calling
addGuest
?
e.g.
event.addGuest("user@example.com", {sendInvite: true})
Change thesendInvites
property on aCalendarEvent
?
e.g.
event.setOptions({sendInvites: true})
- Any other workaround that will produce the same email that is sent when hitting that "Send" button in the UI above?
Update:
- I just saw getAllTagKeys in the API and was hoping I could use that to get the
sendInvites
key, but that's not the case. It is empty even for events that havesendInvites
set to true. - I just tried calling
addGuest
on a newly created event that hassendInvites: true
, but that didn't send an email. - The problem with using MailApp to send an email is that it won't be nicely formatted like the one Google automatically sends out (e.g. with embedded calendar invite, attendees, description, response links, etc, etc, etc).
google-apps-script google-calendar-api
google-apps-script google-calendar-api
edited Jan 1 at 4:41
Senseful
asked Jan 1 at 4:10
SensefulSenseful
46.3k44205324
46.3k44205324
If it isn't done automatically, you will need to send it yourself withMailApp
– tehhowch
Jan 1 at 4:23
Reviewing the advanced service (Calendar rest API) indicates the email will be sent automatically (at least when using the rest API directly) developers.google.com/calendar/concepts/…
– tehhowch
Jan 1 at 4:38
add a comment |
If it isn't done automatically, you will need to send it yourself withMailApp
– tehhowch
Jan 1 at 4:23
Reviewing the advanced service (Calendar rest API) indicates the email will be sent automatically (at least when using the rest API directly) developers.google.com/calendar/concepts/…
– tehhowch
Jan 1 at 4:38
If it isn't done automatically, you will need to send it yourself with
MailApp
– tehhowch
Jan 1 at 4:23
If it isn't done automatically, you will need to send it yourself with
MailApp
– tehhowch
Jan 1 at 4:23
Reviewing the advanced service (Calendar rest API) indicates the email will be sent automatically (at least when using the rest API directly) developers.google.com/calendar/concepts/…
– tehhowch
Jan 1 at 4:38
Reviewing the advanced service (Calendar rest API) indicates the email will be sent automatically (at least when using the rest API directly) developers.google.com/calendar/concepts/…
– tehhowch
Jan 1 at 4:38
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992955%2fhow-do-i-send-the-standard-invitation-email-when-calling-addguest-on-a-calendare%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992955%2fhow-do-i-send-the-standard-invitation-email-when-calling-addguest-on-a-calendare%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If it isn't done automatically, you will need to send it yourself with
MailApp
– tehhowch
Jan 1 at 4:23
Reviewing the advanced service (Calendar rest API) indicates the email will be sent automatically (at least when using the rest API directly) developers.google.com/calendar/concepts/…
– tehhowch
Jan 1 at 4:38