Skip to content

Commit

Permalink
cal description
Browse files Browse the repository at this point in the history
  • Loading branch information
learyjk committed Aug 13, 2024
1 parent de7aa64 commit 6bd7703
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/events/thanks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
document
.querySelector("#apple-calendar")
.addEventListener("click", function (e) {
e.preventDefault();

// Create an iCalendar (.ics) file content with updated event details
const icsContent = `
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
SUMMARY:Top Golf Happy Hour by Envoy
DTSTART;TZID=America/New_York:20240923T203000
DTEND;TZID=America/New_York:20240923T230000
LOCATION:9295 Universal Blvd, Orlando, FL 32819
DESCRIPTION:Thank you for registering for the Envoy Top Golf Happy Hour!\\n\\nAs the event approaches, we will provide you with additional information about the venue and any other necessary details.\\n\\nPrepare to show off your golf skills and get ready for an evening filled with networking and fun! We can't wait to see you at the event! If you have other guests attending, please have each guest RSVP [here](https://envoy.com/events/global-security-exchange-2024).
STATUS:CONFIRMED
SEQUENCE:0
BEGIN:VALARM
TRIGGER:-PT10M
DESCRIPTION:Reminder
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR`;

// Create a Blob from the iCalendar content
const blob = new Blob([icsContent.trim()], { type: "text/calendar" });

// Create a link element and trigger the download
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = "envoy-top-golf-happy-hour.ics";

// Append the link to the body and click it programmatically
document.body.appendChild(link);
link.click();

// Clean up the link after the download
document.body.removeChild(link);
});
1 change: 1 addition & 0 deletions src/utils/form-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function loadMarketoForm(form) {
}
const onloadCallbackName = $form.data("onload-callback");
if (typeof onloadCallbackName !== "undefined") {
console.log({ onloadCallbackName, formId });
window[onloadCallbackName]($form);
}
if ($form.data("load-from-parameters")) {
Expand Down

0 comments on commit 6bd7703

Please sign in to comment.