Dates, Timezones and iCal events/ics files

There are two users UA and UB. They live in different timezones.

Lets say UA can schedule an event for UA and UB at Date/Time T.

And by event I mean making an ics file and emailing it to them so they can put it in their calendars.

How do you make sure that UA and UB get ics files where it shows up in the correct time zone for them even though it was UA that did the scheduling.

Bubble has a built in function for sending emails with an ics file attachment. You should use this for creating the ics file and emailing it to the users. The ics file automatically (at least I believe it does) takes the inputted date data and changes it to a Unix time stamp so that no matter which timezone the recipients are in, it will match properly.

Play around with it and see if it does. If not, then in the inputs for the workflow event to send the email with ics file, use the dynamic expressions to alter the timezone using a dynamic timezone and use the recipients timezone.

Yeah I looked at that and the problem is it uses sendgrid which is a disgraceful fraudulent service that bubble should not be so embedded with. I’ve complained about this directly with them multiple times.

At least last I checked there was no way to switch the native email handler :frowning:

The main problem with sendgrid is that unless you spend $90 a month you cant reliably send emails.

I’ve never tried but is there a way to use the email workflow to create the ics file but not send the email and instead use the ics file as a dynamic value “result of step x” for a subsequent step?

If you can, that would be optimal…otherwise I think there is a plugin that creates ics files for you, that I am pretty confident would have the file available as a dynamic data source.

Prefix edit: Now that Im actually thinking - it doesnt make sense that I need to know the timezone of the recipient. Because thats not possible as a general rule when sending invites. The answer must be in the timezone settings in the ics.

Thanks for helping me churn through this @boston85719

I did look at that option and I couldnt find a way to just send the ics. I know they offer a similar thing with password reset emails …but not with this.

Its not actually a problem to make the ics though. Im already making the ics in javascript and exposing it with the javascript to bubble plugin. The challenge is getting the times in the correct timezone for each user.

Per example above.
User UA is in timezone TA and UB is in timezone TB.

UA will press a button that will result in two emails being send with ICS files. One to UA and one TO UB.

I just need to find a way to adjust the times in the ics for UB so that their the meeting that was set relative to TA is adjusted appropriately to TB.

Confirmed. Setting the time zone in the ICS seems to solve the problem.

What is the javascript you are using to create the ics file?

Like this. Everything in the angle brackets, including the angle brackets, is what I replace with my content. I then set the javascript to bubble thingy to publish the value and listen to its event to continue processing. The output/published value goes into the postmark attachment content field (im using postmark apis so that I can use templated emails - not sure about any of the postmark plugins).

function makeics() {
  let ics =
    "VERSION:2.0\n" +
    "TZID: <use time zone id from browser timezone locale plugin> \n" +
    "BEGIN:VEVENT\n" +
    "ORGANIZER;CN=<Name of sender>:mailto:<email of sender - i use>\n" +
    "SUMMARY:  <title of calendar> \n" +
    "DTSTART: <date with custom formatting yyyymmdd'T'HHMMss> \n" +
    "DTEND: <date with custom formatting yyyymmdd'T'HHMMss> \n" +
    "LOCATION: <zoom link etc> \n" +
    "DESCRIPTION: <body of calendar> \n" +
    "BEGIN:VALARM\n" +
    "TRIGGER:-PT10M\n" +
    "DESCRIPTION:Interview Reminder\n" +
    "END:VALARM\n" +
    "END:VEVENT\n" +

    return ics;
ics = makeics()
icsb = btoa(ics)

How savy are you?

Create a gmail account for your app
Go to
Sign in as your newly created app instead of yourself

Then ship out some short js and publish the script as a webapp

When you publish, you’ll get a url, paste that into your apps api connector

Now you can send html formatted emails

If you continue and want to read their docs or snoop around stackexchange, you can also send the ics as a url attachment

So if how you make them can produce a url, you can the. Email that url. All free and as reliable as gmail can be.

I believe you can send thousands per day for free this way.

I only send formatted emails with online images and texts. I’ve never sent an attachment, I just know it’s possible and a lowly explored option here due to the minor amount of code and research needed. Probably less convinient too.

Well thats clever!

I definitely like free unlimited emails.

Will have to try this out. Thanks!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.