Solved
Email trigger to include an Outlook calendar invite
Does anyone know if it is possible to create an outlook calendar invite attachment based on a date selected in a survey and attach it to email trigger?
The idea being to send an outlook calendar invite after someone signs up for specific time slot.
Best answer by James
I found 2 solutions to your problem:
1 - Survey Termination
This method causes the custom ICS file to be automatically downloaded after the user Submits. This will replace any final message.
At survey end, redirect to a full URL and use the webservice from Agical.io which generates ICS files on the fly.
The base url is `http://ics.agical.io/` and the minimum parameters you will likely use are subject, location, start date/time (dtstart), and end date/time (dtend). For example, using these parameters:
subject=Fourth%20of%20July
location=Community%20Auditorium
dtstart=2018-07-04T15:00:00-04:00
dtend=2018-07-04T16:00:00-04:00
the full url is:
`http://ics.agical.io/?subject=Fourth%20of%20July&location=Community%20Auditorium&dtstart=2018-07-04T15:00:00-04:00&dtend=2018-07-04T16:00:00-04:00`
Note that the Date/Times are in ISO format and, of course, you'd need to replace the values in the string with embedded field strings containing the event description. Before the last question, you'll
need to convert the date picked to ISO and store it in an embedded field so the generated URL can read it.
To generate a Google "add to calendar" use `format=gcal`.
2 - Generate ICS as part of the survey flow
This method causes the custom ICS file to be automatically downloaded before the user submits. This allows you to conditionally provide it to the user based on their preferences.
Download https://github.com/nwcell/ics.js and upload two .js files (either of the ics files and the ics.deps.min.js) into your Qualtrics library. Then, include them in the header like this:
<script type="text/javascript" src="https://xxx.az1.qualtrics.com/ControlPanel/File.php?F=F_5ci9xpvtuLRiiaT"></script>
<script type="text/javascript" src="https://xxx.az1.qualtrics.com/ControlPanel/File.php?F=F_56LodesR935noqh"></script>
To test, I used the Qualtrics provided date-picker. You can easily import it by selecting the second variation in the Demographics/Calendar & Date Questions.
After a page break, or in the next block, you can reference the date picked.
Here is the question javascript code to instantiate the ics file and convert the date:
var cal = ics();
var pickDate = "<dollar-sign>{q://QID2/ChoiceTextEntryValue}";
var newDate = pickDate.replace(/-/g,"/");
cal.addEvent('Demo Event', 'This is an all day event', 'Nome, AK', newDate, newDate);
cal.download();
\\[Replace `<dollar sign>` above with an actual dollar symbol, the forum editor chokes when I code the $.\\]
Note that I left the default/sample values for description and location; you'd need to change those (along with the proper reference to the user date selection).
The question text should indicate the file is being downloaded or just a 'thanks.'
View originalLeave a Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.