Back to Documentation

Automated add to calendar links for emails

This tool is a link with customizable parameters that can be used to create an event on-the-fly, or send your users to their calendar service where they can add your event, or attach your event to an email you send to your users.

The API requires an API token to work.
Please sign in or create an account to receive your accounts API tokens.

lock_open
  • Create an add to calendar link in e.g. newsletters. The link redirects your user to an event page.
    Add event to your calendar
  • Create an add to calendar link in e.g. newsletters. The link redirects to the specified service.
    Add event to your calendar: Apple     Google     Office 365     Outlook     Outlook.com     Yahoo
  • Attach an event file in e.g. newsletters/reminders using your existing Mail API. See example below for details.

Create an event on-the-fly (endpoint: event page)

Creates an event on-the-fly. The users end up on an event page.

<a href="https://www.addevent.com/dir/?client=CLIENT&start=start&end=end&title=title&timezone=timezone">Add to Calendar</a>
                    
<a href="https://www.addevent.com/dir/?client=USER-CLIENT-ID&start=10%2F19%2F2024+09%3A00+AM&end=10%2F19%2F2024+11%3A00+AM&title=Title+of+the+event&description=Description+of+the+event&location=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA+94043&timezone=America%2FLos_Angeles">Add to Calendar</a> 
                        

Create an event on-the-fly (endpoint: calendar service)

Creates an event on-the-fly. Downloads an event file or redirects the user to the calendar client.

Add to Calendar: 
<a href="https://www.addevent.com/dir/?client=CLIENT&start=start&end=end&title=title&timezone=timezone&service=service">Link Text</a> 
Add to Calendar: 
<a href="https://www.addevent.com/dir/?client=USER-CLIENT-ID&start=10%2F19%2F2024+09%3A00+AM&end=10%2F19%2F2024+11%3A00+AM&title=Title+of+the+event&description=Description+of+the+event&location=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA+94043&timezone=America%2FLos_Angeles&service=apple">Apple</a> 
<a href="https://www.addevent.com/dir/?client=USER-CLIENT-ID&start=10%2F19%2F2024+09%3A00+AM&end=10%2F19%2F2024+11%3A00+AM&title=Title+of+the+event&description=Description+of+the+event&location=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA+94043&timezone=America%2FLos_Angeles&service=google">Google</a> 
<a href="https://www.addevent.com/dir/?client=USER-CLIENT-ID&start=10%2F19%2F2024+09%3A00+AM&end=10%2F19%2F2024+11%3A00+AM&title=Title+of+the+event&description=Description+of+the+event&location=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA+94043&timezone=America%2FLos_Angeles&service=office365">Office 365</a> 
<a href="https://www.addevent.com/dir/?client=USER-CLIENT-ID&start=10%2F19%2F2024+09%3A00+AM&end=10%2F19%2F2024+11%3A00+AM&title=Title+of+the+event&description=Description+of+the+event&location=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA+94043&timezone=America%2FLos_Angeles&service=outlook">Outlook</a> 
<a href="https://www.addevent.com/dir/?client=USER-CLIENT-ID&start=10%2F19%2F2024+09%3A00+AM&end=10%2F19%2F2024+11%3A00+AM&title=Title+of+the+event&description=Description+of+the+event&location=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA+94043&timezone=America%2FLos_Angeles&service=outlookcom">Outlook.com</a> 
<a href="https://www.addevent.com/dir/?client=USER-CLIENT-ID&start=10%2F19%2F2024+09%3A00+AM&end=10%2F19%2F2024+11%3A00+AM&title=Title+of+the+event&description=Description+of+the+event&location=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA+94043&timezone=America%2FLos_Angeles&service=yahoo">Yahoo</a>

Attach an event in newsletters

If you send emails using a Mail API or your own code you can attach an event file in an email.
In the example you'll find an example on how to attach an event using the Mandrill Mail API.
The same technique can be applied to almost any other service used for sending out emails.

https://www.addevent.com/dir/?client=CLIENT&start=start&end=end&title=title&description=description&timezone=timezone&service=stream
                    
// Get event file for attachment
$attachment = file_get_contents('https://www.addevent.com/dir/?
client=USER-CLIENT-ID&start=10%2F19%2F2024+09%3A00+AM&
end=10%2F19%2F2024+11%3A00+AM&title=Title+of+the+event&
description=Description+of+the+event&timezone=America%2FLos_Angeles&
service=stream');

// Event file: Base 64 encode the event file
$attachment_encoded = base64_encode($attachment);

// Set message object
$compose = array(
   'html' => 'Email content',
   'subject' => 'Email subject',
   'from_email' => 'from@example.com',
   'to' => array(
       array(
           'email' => 'to@example.com'
       )
   ),
   'attachments' => array(
       array(
           'content' => $attachment_encoded,
           'type' => 'text/calendar',
           'name' => 'event.ics',
       )
   )
);

// Send the email
$response = $mandrill->messages->send($compose);
Parameter
Description
client
Required

Account client ID. The account client ID is available in the Account section and is incorporated in all code examples on this page.
start
Required

Start date of the event. Accepts most date/time formats, e.g. 10/05/2024 03:00 PM (12-hour format) or 05-10-2024 15:00 (24-hour format).

Use numeric values to describe the date, e.g. "" and not textual, e.g. "".

Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed. If, however, the year is given in a two digit format and the separator is a dash (-, the date string is parsed as y-m-d. To avoid potential ambiguity, it's best to use ISO 8601 (YYYY-MM-DD) dates

Date examples:
10/05/2024 03:00 PM or 05-10-2024 15:00 or 2024/10/05 03:00 PM or 2024-10-05 15:00
end
End date of the event. Accepts most date/time formats, e.g. 10/05/2024 05:00 PM (12-hour format) or 05-10-2024 17:00 (24-hour format).

Use numeric values to describe the date, e.g. "" and not textual, e.g. "".

Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed. If, however, the year is given in a two digit format and the separator is a dash (-, the date string is parsed as y-m-d. To avoid potential ambiguity, it's best to use ISO 8601 (YYYY-MM-DD) dates

Date examples:
10/05/2024 05:00 PM or 05-10-2024 17:00 or 2024/10/05 05:00 PM or 2024-10-05 17:00

If end is not defined, the end date is automatically set to start date plus one hour.
duration
Duration of the event in minutes, e.g. "30". Ignores the end date if set and adds the minutes to the start date.
title
Required

Title of the event. Single line string.
description
Description of the event. Use <br> or \n to separate lines.

The field accepts plain text or simplified HTML. Simplified HTML is supported by calendar clients like Outlook and Apple Calendar. If the calendar client does accept HTML, the content of the field is automatically converted into readable text.

Keep the description short and to the point. Link to a website for further details if the event description is long. Maximum 500 characters recommended.

Reason: Most modern browsers allow an unlimited number of characters to be transferred by the browser. Internet Explorer / Edge only allows ~2000 characters. A 500 characters maximum is recommended to make sure your event is cross browser compatible.

For the "Outlook.com" and "Office 365" options the description is automatically truncated after 700 characters when not using the Microsoft Events API version. The reason is that longer descriptions (unfortunately) will make Microsoft's Calendar services fail.
location
Event location, eg. "Eiffel Tower, Paris".
organizer
Event organizer, e.g. "John Johnson".

If you fill out organizer you must also include the organizer_email field.

If you include an organizer and an organizer_email, the event is considered to be a "meeting" by calendar clients like Outlook. If you don't include the fields, the event is considered to be an "appointment".
organizer_email
Event organizer e-mail, e.g. "your@email.com".

If you fill out organizer_email you must also include the organizer field.

If you include an organizer and an organizer_email, the event is considered to be a "meeting" by calendar clients like Outlook. If you don't include the fields, the event is considered to be an "appointment".
all_day_event
All day event. Accepts true or false.
date_format
The format of the date in start and end. Accepts the values MM/DD/YYYY or DD/MM/YYYY only. Lets the engine know how to handle the date, e.g. 12-hour format (MM/DD/YYYY) or 24-hour format (DD/MM/YYYY).

The date_format used to be mandatory but is optional today.
timezone
The events time zone, e.g. Europe/Paris or America/Los_Angeles.

If timezone is applied (recommended), date/time will be converted to Zulu time / GMT / UTC. If timezone is not applied, date/time will be parsed as is (fluid date/time).

Explanation: The timezone parameter makes sure the date/time is correct no matter if you are in New York or Sydney. If your event has users from multiple time zones in the world, it's highly recommended to use the parameter.
reference
Value to keep track of events. Used for statistics. E.g. "iPhone" or "Newsletter Oct 2016" or URL reference.
linkback
In case an event description is truncated it can be useful to provide a link back to a full event details page. If the linkback property contains any information AND the event description has been truncated the linkback property is added after the truncated event description.
service
Accepts: apple or google or office365 or outlook or outlookcom or yahoo or stream.

If a service is specified, e.g. "apple" the event will be downloaded immediately to the users computer/device. If service isn't defined, the user will be redirected to an event page. Example: https://www.addevent.com/event/?db52444.

Use the value stream if you want to attach event files in your existing Mail API.
template
Id of a "Custom Event Page" template, e.g. "lm2015e14o720j11". Uses the "AddEvent default" template if template is not defined.
In order to create/access custom templates please go to "Events" -> "New Event" and save it. Then scroll down the page and click the "Custom template" button. With "Custom templates" you can edit all HTML of the event page, change date formats (e.g. 24-hour clock) etc.
alarm
Event reminder. Trigger an event reminder e.g. "15" minutes before the event starts.
Accepted input: Number

Example: Reminder "15" minutes before event starts = 15 or
one day before event starts : 60 minutes x 24 hours = 1440.

Event reminders are currently supported by:
- Apple Calendar
- Google Calendar (using Google Events API)
- Outlook
- Outlook.com (using Microsoft Events API)
recurring
Recurring rule, e.g. FREQ=WEEKLY;UNTIL=20241110T080000Z;BYDAY=WE,TH,FR
Make the event repeat for a number of times.

Generate Recurring Rulebuild

Recurring rules are advanced and needs to be tested before you publish it. Please notice: The start date/time must match the recurrence rule in order to work in strict calendar systems like Outlook and Apple Calendar.

Recurring rules are currently supported by:
- Apple Calendar
- Google Calendar (using "Direct" and Google Events API)
- Office 365 (using the Microsoft Events API)
- Outlook
- Outlook.com (using Microsoft Events API)
calname
Custom filenaming of the .ics file used for e.g. Outlook and Apple Calendar. If not defined the name defaults to "event.ics". Use the phrase use-title to use the title from the title parameter or enter a custom filename.
attendees
Add one or multiple attendees (pre-populated) to the event. Enables the pre-populated attendee(s) to get a response from the attendee. Separate multiple attendees (email addresses) with a comma.

Examples:
joe@example.com or joe@example.com,jack@example.com
uid
Define your own UID for the event. If not defined, a system UID is generated. Please notice; Yahoo Calendar reports error 404 if an UID is defined. We therefore don't include UID's in Yahoo Calendar.

Warning. Use this option only if it serves a purpose in your coding.
status
Define the status parameter in the .ics file used for e.g. Outlook and Apple Calendar. The options can be CONFIRMED, TENTATIVE, CANCELLED, NEEDS-ACTION, COMPLETED, IN-PROCESS according to the iCalendar guidelines.
If the value is not defined (recommended), the system defaults to "CONFIRMED".

Warning. Use this option only if it serves a purpose in your coding.
method
If defined, a method parameter is added in the .ics file used by e.g. Outlook and Apple Calendar. If not defined, no method parameter is added in the .ics file. http://www.kanzaki.com/docs/ical/method.html + https://tools.ietf.org/html/rfc2446

Examples of usage:
PUBLISH, REQUEST, CANCEL, "REFRESH".

Warning. Use this option only if it serves a purpose in your coding.
transp
<span class="transp">TRANSPARENT</span>

Determines whether the event appears as "free" or "busy" on the users calendar. Default value is OPAQUE (busy).

Accepted values:
TRANSPARENT or OPAQUE.