InteractionDesignFoundation / add-event-to-calendar-docs

📅 Docs how to generate links to add events to online calendar services
https://interactiondesignfoundation.github.io/add-event-to-calendar-docs/
MIT License
429 stars 57 forks source link

Add multi-line body for Outlook Web? #14

Closed jaredlt closed 4 years ago

jaredlt commented 4 years ago

Do you know if it's possible to add a multi-line body for Outlook Web?

For Google and Yahoo you simple pass in the newline value \n (url encoded: %0A). But this doesn't seem to work for Outlook Web. I've also tried \r (url encoded: %0D) and \r\n but neither appear to work.

alies-dev commented 4 years ago

@jaredlt just use url encode (%0A), it should work:

https://calendar.yahoo.com/?v=60&title=Birthday&st=20201231T193000&et=20201231T223000&desc=With%20clowns%20and%20stuff%0Anew%20line&in_loc=North%20Pole

image

jaredlt commented 4 years ago

@lptn I know it works for Google and Yahoo. But I was asking specifically for Outlook Web as it doesn't appear to work the same.

In the below example https://www.example.com/event-details should be on a double new line:

https://outlook.live.com/calendar/0/deeplink/compose?path=/calendar/action/compose&rru=addevent&subject=Christmas%20party%21&startdt=2020-12-12T13:30:00Z&enddt=2020-12-12T14:30:00Z&body=Come%20join%20us%20for%20lots%20of%20fun%20%26%20cake%21%0A%0Ahttps%3A%2F%2Fwww.example.com%2Fevent-details

outlook-web

alies-dev commented 4 years ago

@jaredlt This is what they use in their code:

if (params[BODY_QUERYSTRING_KEY]) {
    event.Body = {
        BodyType: 'HTML',
        Value: HtmlSanitizer.sanitizeHtml(params[BODY_QUERYSTRING_KEY]),
    };
}

I assume that their HtmlSanitizer has a bug/feature. I just tried to use <br> HTML tag and it works:

image

URL: https://outlook.live.com/calendar/0/deeplink/compose?path=/calendar/action/compose&rru=addevent&subject=Christmas%20party%21&startdt=2020-12-12T13:30:00Z&enddt=2020-12-12T14:30:00Z&body=With%20clowns%20and%20stuff%3Cbr%3Enew%20line

jaredlt commented 4 years ago

@lptn oh, that's awesome! Didn't even think to try a <br> :/

Thanks so much for your help :)