How do I send the standard invitation email when calling addGuest on a CalendarEvent?












1















Whenever I add a guest via the Google Calendar UI, the following dialog pops up:




enter image description here




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:





  1. Choose to send an invite when calling addGuest?



    e.g. event.addGuest("user@example.com", {sendInvite: true})




  2. Change the sendInvites property on a CalendarEvent?



    e.g. event.setOptions({sendInvites: true})



  3. 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 have sendInvites set to true.

  • I just tried calling addGuest on a newly created event that has sendInvites: 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).










share|improve this question

























  • 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
















1















Whenever I add a guest via the Google Calendar UI, the following dialog pops up:




enter image description here




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:





  1. Choose to send an invite when calling addGuest?



    e.g. event.addGuest("user@example.com", {sendInvite: true})




  2. Change the sendInvites property on a CalendarEvent?



    e.g. event.setOptions({sendInvites: true})



  3. 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 have sendInvites set to true.

  • I just tried calling addGuest on a newly created event that has sendInvites: 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).










share|improve this question

























  • 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














1












1








1








Whenever I add a guest via the Google Calendar UI, the following dialog pops up:




enter image description here




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:





  1. Choose to send an invite when calling addGuest?



    e.g. event.addGuest("user@example.com", {sendInvite: true})




  2. Change the sendInvites property on a CalendarEvent?



    e.g. event.setOptions({sendInvites: true})



  3. 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 have sendInvites set to true.

  • I just tried calling addGuest on a newly created event that has sendInvites: 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).










share|improve this question
















Whenever I add a guest via the Google Calendar UI, the following dialog pops up:




enter image description here




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:





  1. Choose to send an invite when calling addGuest?



    e.g. event.addGuest("user@example.com", {sendInvite: true})




  2. Change the sendInvites property on a CalendarEvent?



    e.g. event.setOptions({sendInvites: true})



  3. 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 have sendInvites set to true.

  • I just tried calling addGuest on a newly created event that has sendInvites: 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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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



















  • 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

















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












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
});


}
});














draft saved

draft discarded


















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
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

A Topological Invariant for $pi_3(U(n))$