Generating ICS files and emailing them.

Before you can generate ICS files, you must have the necessary fields defined in the module to capture the Summary, Description, Start, End and optionally the location.

E.g.

The easiest way to generate ICS files and email them is using the ‘Report Generation’ features in workflow sub actions.

The first step in this process is to create an attachment field and associate it to where the ics file is stored.

Follow this link to create an attachment field.

How to: Add an Attachment Field - Support Center - Confluence (atlassian.net)

Once you have the attachment field generated and saved via the form designer, navigate to the Shared Lookups under the module settings and navigate to the ‘HTML Templates’ lookup.

 

Add a new HTML template lookup item by clicking the ‘New’ button. The HTML template’s name must begin with ‘ics_’ e.g. ‘ics_template1'. Copy and paste the ics template shown below this screen shot to the 'Html’ field.

Here is an example of how the ics_template1 lookup item would look.

Template for the ics file.

BEGIN:VCALENDAR PRODID:-//stratawise//_Scheduler//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:REQUEST BEGIN:VEVENT DTSTART:%(CustomDateTime4:Format"{0:yyyyMMddTHHmmssZ}")% DTEND:%(CustomDateTime5:Format"{0:yyyyMMddTHHmmssZ})% DTSTAMP:%(CreatedOn:Format"{0:yyyyMMddTHHmmssZ})% ORGANIZER;CN=%(LoggedInUsersFirstName)% %(LoggedInUsersLastName)%:mailto:%(LoggedInUsersEmailAddress)% UID:%(BLEntityId)%@stratawise.com CREATED:%(CreatedOn:Format"{0:yyyyMMddTHHmmssZ})% DESCRIPTION:%(CustomLongText2)% LAST-MODIFIED:%(LastModifiedOn:Format"{0:yyyyMMddTHHmmssZ})% LOCATION:%(customString1)% SEQUENCE:%(ICS.NextSequenceCount)% STATUS:CONFIRMED SUMMARY:%(customString9)% TRANSP:OPAQUE END:VEVENT END:VCALENDAR

 

The variables in the ics template that match the start date, end date, summary, description & location must be changed to match the variables that you are using to store the corresponding values. For example,

Once the ics template is created under the HTML template lookups, then you need to setup the workflow action to generate the ics attachment and attach to the field you created above.

Follow the instructions provided via this link to create the subaction necessary to create the ics attachment.

Here is how your subaction to generate the attachment would like. For e.g. The ‘Submit’ action would generate the attachment and store it to the icsAttachment field.

The final step is to include the ics attachment in the email by following the instructions in this link.

 

Emailing an updated .ics attachment

To send an updated .ics attachment, you must create a workflow action e.g. ‘Send Updated ics’, that can be performed after the item is initially saved.

You would follow the above steps to setup the subaction to generate the attachment and also include the attachment as part of the update workflow action’s email.