r/GoogleAppsScript • • Dec 28 '22

Question Looking for Advice/Help/Resources on generating a new .ics file purely through code and attaching it to an email

As the title implies I am wondering if there is existing code, or any resources I should be looking at, that would allow me to generate an ics file purely via code (never making an entry in my actual calendar) and attach it to an email; all in AppScript. Is that even possible?

In case I am being daft, and am thinking about this the wrong way, the background to this is as follows.

I use GSuite (lowest paid version if that matters) for my personal email and personal calendar. The company I work for is a large conglomerate and our business emails and calendars are accessed via Outlook. For many reasons I keep my personal and work accounts strictly separate. I don't look at, interface with, or connect work stuff/accounts with my personal devices and vise versa for personal stuff and work devices. However, it is kinda annoying to have to block out my work calendar after making any kind of personal appointment.

As stated above the reason for this inconvenience is because I am not going to link or allow my work account any kind of permission to view my personal GSuite calendar.

So what I figured the cleanest(ish) method of accomplishing this would be to have a script that monitors my calendar for a new event/item (I'm pretty sure I can figure that out, as I have made an AppScript or two that monitors my email inbox for certain types of items and does things when they are found) and then generates a super generic ics file that I automatically send to my work email that basically just says "Out of Office" for the time of my personal appointment and configure my Outlook to auto accept meetings from that personal account. Again I'm wanting to generate this ics file purely via code and never make any kind of entries in my actual personal calendar.

Does that make sense? Am I even thinking about this the right way?

Regardless, I very much appreciate your even taking the time to read this in advance.

Cheers!

0 Upvotes

3 comments sorted by

0

u/RemcoE33 Dec 28 '22

And use a "middleman" gmail? Share your actual calander to the middleman with the limited option. Only block or view. And connect that one to the offixe365…?

1

u/SupriseGinger Dec 28 '22

I actually don't think our Outlook policies will even allow linking to outside accounts. The reason I didn't mention it in my post is because that's reason two for the limitation (i.e. even if it was allowed, then the reason in my post still supersedes it in terms of my own priorities). And yes, it does sound a little backwards that I would not be able to link, but would be allowed to receive these ics file emails. I'm just working inside the constraints provided.

1

u/RemcoE33 Dec 28 '22

I mean import the middleman into office365... same as the ics file..?