Creating a Cloud Page for One-Click Meeting Calendar Subscriptions

Calendars
Home Page

Creating a Cloud Page for One-Click Meeting Calendar Subscriptions


Add Event to Multiple Calendars

Select your preferred calendar service:

Add to Google Calendar Add to Yahoo Calendar Add to Office 365 Calendar Add to Apple Calendar

Step 1: Set Up Your Cloud Page

The first step is to create a cloud page for your event or meeting. You can use a variety of web development tools and platforms to set up this page. HTML, CSS, and JavaScript will be essential in the process. Make sure the page is user-friendly and provides essential information about the event, such as the date, time, location, and a brief description.

Step 2: Implement Event Information

To make the process of saving the event to various calendar apps easy, you need to provide the event details in a structured format. This information should be embedded in your cloud page's code. Create variables or data fields for the event name, date, time, location, and description. This data will be used in the links you create for each calendar service.

Step 3: Generate Calendar Links

Now, let's dive into the specifics of how your subscribers can save the meeting calendar to their preferred calendar apps. We'll provide examples for Google Calendar, Yahoo Calendar, Office 365, and Apple Calendar.

Google Calendar

To create a link for Google Calendar, you can use the following code snippet:


function generateGoogleCalendarLink(event) {
            var link = 'https://www.google.com/calendar/render?action=TEMPLATE';

            if (event.title) {
                link += '&text=' + encodeURIComponent(event.title);
            }

            if (event.startDate && event.endDate) {
                link += '&dates=' + encodeURIComponent(event.startDate + '/' + event.endDate);
            }

            if (event.description) {
                link += '&details=' + encodeURIComponent(event.description + '\nJoin URL: ' + event.joinURL);
            }

            if (event.address) {
                link += '&location=' + encodeURIComponent(event.address);
            }

            return link;
        }
            
                
// Handle click events for each calendar service
        document.getElementById("addToGoogleCalendar").addEventListener("click", function () {
            var eventDetails = {
                title: 'Sample Event',
                startDate: '20230102T090000Z',
                endDate: '20230102T100000Z',
                description: 'This is a sample event description.',
                address: 'Sample Location',
                joinURL: 'https://example.com/event/join'
            };
            window.open(generateGoogleCalendarLink(eventDetails));
        });                    
                
            

Yahoo Calendar

To create a link for Yahoo Calendar, use the following code:


function generateYahooCalendarLink(event) {
            var link = 'https://calendar.yahoo.com/?v=60&view=d&type=20';

            if (event.title) {
                link += '&title=' + encodeURIComponent(event.title);
            }

            if (event.startDate && event.duration) {
                link += '&st=' + encodeURIComponent(event.startDate);
                link += '&dur=' + encodeURIComponent(event.duration);
            }

            if (event.description) {
                link += '&desc=' + encodeURIComponent(event.description + '\nJoin URL: ' + event.joinURL);
            }

            if (event.address) {
                link += '&in_loc=' + encodeURIComponent(event.address);
            }

            return link;
        }
    

document.getElementById("addToYahooCalendar").addEventListener("click", function () {
            var eventDetails = {
                title: 'Sample Event',
                startDate: '20230102T090000Z',
                duration: '01h00m', // Example duration (1 hour)
                description: 'This is a sample event description.',
                address: 'Sample Location',
                joinURL: 'https://example.com/event/join'
            };

            window.open(generateYahooCalendarLink(eventDetails));
        });    

Office 365

For Office 365, you can use the following code:

 
function generateOutlookCalendarLink(event) {
            var sd = event.startDate || '';
            var ed = event.endDate || '';

            var link = encodeURI([
                "https://outlook.office365.com/owa/",
                "?path=/calendar/action/compose",
                "&rru=addevent",
                "&subject=" + (event.title || ''),
                "&startdt=" + (event.startDate),
                "&enddt=" + (event.endDate),
                "&body=" + (event.description + '\nJoin URL: ' + event.joinURL || ''),
                "&location=" + (event.address || ''),
                (event.allday ? "&allday=true" : '')
            ].join(''));

            return link;
        }
    

  document.getElementById("addToOffice365Calendar").addEventListener("click", function () {
            var eventDetails = {
                title: 'Sample Event',
                startDate: '20230102T090000Z',
                endDate: '20230102T100000Z',
                description: 'This is a sample event description.',
                address: 'Sample Location',
                joinURL: 'https://example.com/event/join'
            };
            window.open(generateOutlookCalendarLink(eventDetails));
        });    

Apple Calendar

To create a link for Apple Calendar, use this code:


 function generateAppleCalendarLink(event) {
            var link = 'https://www.apple.com/ical/v1/add';

            if (event.startDate) {
                link += '&st=' + encodeURIComponent(event.startDate);
            }

            if (event.endDate) {
                link += '&end=' + encodeURIComponent(event.endDate);
            }

            if (event.title) {
                link += '&summary=' + encodeURIComponent(event.title);
            }

            if (event.description) {
                link += '&description=' + encodeURIComponent(event.description + '\nJoin URL: ' + event.joinURL);
            }

            if (event.address) {
                link += '&location=' + encodeURIComponent(event.address);
            }

            return link;
        }
    

document.getElementById("addToAppleCalendar").addEventListener("click", function () {
            var eventDetails = {
                title: 'Sample Event',
                startDate: '20230102T090000Z',
                endDate: '20230102T100000Z',
                description: 'This is a sample event description.',
                address: 'Sample Location',
                joinURL: 'https://example.com/event/join'
            };
            window.open(generateAppleCalendarLink(eventDetails));
        });

Step 4: Add Calendar blocks CTA


<div class="container">
        <h1>Add Event to Multiple Calendars</h1>
        <p>Select your preferred calendar service:</p>

        <a href="#" class="calendar-link calendar-link-google" id="addToGoogleCalendar">
            <i class="fas fa-google"></i> Add to Google Calendar
        </a>
        <a href="#" class="calendar-link calendar-link-yahoo" id="addToYahooCalendar">
            <i class="fas fa-yahoo"></i> Add to Yahoo Calendar
        </a>
        <a href="#" class="calendar-link calendar-link-office365" id="addToOffice365Calendar">
            <i class="fas fa-envelope"></i> Add to Office 365 Calendar
        </a>
        <a href="#" class="calendar-link calendar-link-apple" id "addToAppleCalendar">
            <i class="fas fa-apple"></i> Add to Apple Calendar
        </a>
 </div>        
    

Step 5: Testing and Integration

Before making your cloud page live, thoroughly test the links for each calendar service. Ensure that they correctly generate the event details in the respective calendar apps.

Finally, integrate these links into your cloud page alongside your event details. Encourage your subscribers to click on their preferred calendar service link to add the meeting to their calendar easily.

Conclusion

Creating a cloud page with one-click access to save events to Google Calendar, Yahoo Calendar, Office 365, and Apple Calendar is a valuable tool for event organizers and subscribers alike. By following the steps outlined in this blog, you can streamline the process of scheduling and help your audience stay organized effortlessly. This user-friendly feature will enhance the experience for your subscribers and make your events more accessible and memorable.




Comments


Knowledge Article

Most Viewed

CLOUD PAGE ENABLEMENT - PART 1

EMAIL NOT SENT IN JOURNEY BUILDER

CONSIDERATIONS FOR JOURNEY BUILDER

Journey Builder REST API Documentation

Preference Center Demystified

Popular Posts

CLOUD PAGE ENABLEMENT - PART 1

EMAIL NOT SENT IN JOURNEY BUILDER

CONSIDERATIONS FOR JOURNEY BUILDER

Journey Builder REST API Documentation

Preference Center Demystified

SEND LOG EANBLEMENT

Share with Friends

Disclaimer:

The information provided on this technical blog is for general informational purposes only. As a SFMC (Salesforce Marketing Cloud) Technical Architect, I strive to offer accurate and up-to-date content related to SFMC and its associated technologies. However, please note that technology is constantly evolving, and the information provided may become outdated or inaccurate over time.

The content published on this blog represents my personal views and experiences as a SFMC Technical Architect and does not necessarily reflect the official views or opinions of any organization or employer I may be affiliated with.

While I make every effort to ensure the accuracy and reliability of the information presented, I cannot guarantee its completeness, suitability, or applicability to your specific circumstances. Therefore, it is essential to verify any information provided and make your own independent assessments or seek professional advice if needed.

Furthermore, any actions taken based on the information provided on this blog are at your own risk. I shall not be held liable for any damages, losses, or inconveniences arising from the use of the information presented here.

Please keep in mind that SFMC and its associated technologies are complex and require technical expertise for proper implementation and management. It is recommended to consult with qualified professionals or official SFMC documentation for comprehensive guidance.

Finally, please note that any product or company names mentioned on this blog are trademarks or registered trademarks of their respective owners. The mention of these trademarks or registered trademarks does not imply any endorsement or affiliation with the blog.

By accessing and using this blog, you agree to the terms of this disclaimer. If you do not agree with any part of this disclaimer, please refrain from using this blog.