Process for automating survey emails with qualtrics This script and process was made following this tutorial along with Qualtrics API references
This procedure should require little to no programming experiece, but some knowedge of python may help with troublshooting.
It was made using:
The process invloves 3 basic parts
EXTRA:
This project assumes the windows machine that is set up for the automatic mailings will stay running to complete tasks, in the windows task scheduler setting there is an option to run if a task is missed. For best results of this automation it is best on a machine that stays on. (For cron job set up it could even be made to run on a raspberry pi). For future development of this automation I am looking at google's cloud scheduler but need to research security, cost, etc. I am open to any other options if you have recommendations
The survey, message, and mailing lists are already created in the qualtrics system so you don't need to create anything new. Just need to find the string ID references.
This shows the Object ids associated with your profile. I actually set up a sample mailing list, survey, and message to test the automation. You may do the same to make sure this procedure works before mailing out to the entire list.
Data Center is in the URL https://[DATA CENTER].qualtrics.com/Q/MyProjectsSection
Clone or copy this repository to your system in a directroy you can remember as it will need to be referenced in the Windows Task Scheduler later
I have included the virtual enviornment with all dependencies, so it should work with little to no intervention
Add API token and data center to script main.py
# NEED TO SET
apiToken = '#########API TOKEN ###########' # hard coding API token for ease, but can set as env variable
dataCenter = '####### DATA CENTER ########' # will be the same across sites.
Add the correct Object Ids to the python script in main.py
#qualtrics API object IDs
mailingListId = "ML_###############" # NEED TO SET
messageId = 'MS_###############' # NEED TO SET
libraryId = 'GR_###############' # NEED TO SET
surveyId = 'SV_###############' # NEED TO SET
Change the mailer options in main.py
#NEED TO SET MAILER OPTIONS
header['fromEmail'] = "noreply@qualtrics.com"
header['fromName'] = "The CART team at [YOUR SITE]" # NEED TO SET
header['replyToEmail'] = "YOUR_EMAIL@site.edu" # NEED TO SET
header['subject'] = "Weekly Health Update Form" # CAN CHANGE
Once the script is complete you can actually just run it to send out the surveys to the mailing list if you wanted. (This is how you can test the script is working if you create a sample mailing list, message and survey) Remeber to change back Qualtrics IDs if you do this
I used a Windows 10, but should work on any Windows system.
- Locate the Task Scheduler by searching for it at the start menu
IT IS A GOOD IDEA TO TEST WITH A SAMPLE SURVEY, MESSAGE, AND MAILING LIST TO ENSURE THE DISTRIBUTION WORKS AT YOUR SITE BEFORE ROLLING OUT TO ALL PARTICIPANT
To send a survey link to a phone as a text message, most service carriers allow this for phone. Explained here.
Make sure the participant requests this and that they will not be charged by thier provider for text messages
Tested by adding this email format instead of the email address, sender is from "noreply@qualrtics.com" or whatever the "fromEmail" is set as.
AT&T: number@txt.att.net (SMS), number@mms.att.net (MMS) T-Mobile: number@tmomail.net (SMS & MMS) Verizon: number@vtext.com (SMS), number@vzwpix.com (MMS) Sprint: number@messaging.sprintpcs.com (SMS), number@pm.sprint.com (MMS) XFinity Mobile: number@vtext.com (SMS), number@mypixmessages.com (MMS) Virgin Mobile: number@vmobl.com (SMS), number@vmpix.com (MMS) Tracfone: number@mmst5.tracfone.com (MMS) Metro PCS: number@mymetropcs.com (SMS & MMS) Boost Mobile: number@sms.myboostmobile.com (SMS), number@myboostmobile.com (MMS) Cricket: number@sms.cricketwireless.net (SMS), number@mms.cricketwireless.net (MMS) Republic Wireless: number@text.republicwireless.com (SMS) Google Fi (Project Fi): number@msg.fi.google.com (SMS & MMS) U.S. Cellular: number@email.uscc.net (SMS), number@mms.uscc.net (MMS) Ting: number@message.ting.com Consumer Cellular: number@mailmymobile.net C-Spire: number@cspire1.com Page Plus: number@vtext.com
The surveys should be fine as a SMS as there is no need for images, only the clickable link needs to go through. (Tested on Google Fi, more testing will need to be done to validate it with more providers)