{"name":"Course Completed","description":"{\"text\":\"

This workflow sends an email to a student when they have successfully completed a course.<\\\/p>

The workflow will also send the completion details to an external system via HTTP Post.
<\\\/p>\",\"format\":\"1\"}","event":"\\core\\event\\course_completed","steps":{"93":{"id":"93","name":"Course Filter","description":"We don't want this workflow to complete for the Maths 101 course.","type":"filters","stepclass":"\\tool_trigger\\steps\\filters\\numcompare_filter_step","data":"{\"field1\":\"courseid\",\"operator\":\"==\",\"field2\":\"6\",\"stepdesc\":\"Number comparison\",\"typedesc\":\"Filter\"}","steporder":"0"},"87":{"id":"87","name":"Course Lookup","description":"Lookup the course details, based on the course ID in the triggered event.","type":"lookups","stepclass":"\\tool_trigger\\steps\\lookups\\course_lookup_step","data":"{\"courseidfield\":\"courseid\",\"outputprefix\":\"course_\",\"stepdesc\":\"Course lookup\",\"typedesc\":\"Lookup\"}","steporder":"1"},"88":{"id":"88","name":"User Lookup","description":"Lookup the details of the student who completed the course based on the related user ID in the event.","type":"lookups","stepclass":"\\tool_trigger\\steps\\lookups\\user_lookup_step","data":"{\"useridfield\":\"relateduserid\",\"outputprefix\":\"user_\",\"nodeleted\":\"1\",\"stepdesc\":\"User lookup\",\"typedesc\":\"Lookup\"}","steporder":"2"},"91":{"id":"91","name":"Email User","description":"Send the user a congratulations email for completing the course.","type":"actions","stepclass":"\\tool_trigger\\steps\\actions\\email_action_step","data":"{\"emailto\":\"{user_email}\",\"emailsubject\":\"Course complete: {course_shortname}\",\"emailcontent\":\"Congratulations {user_firstname} {user_lastname}\\r\\n\\r\\nYou have successfully completed the course:\\r\\n{course_fullname} ({course_shortname})\\r\\nKeep up the good work.\",\"stepdesc\":\"Email\",\"typedesc\":\"Action\"}","steporder":"3"},"92":{"id":"92","name":"HTTP Post","description":"Let an external system know about the course completion information for this user.","type":"actions","stepclass":"\\tool_trigger\\steps\\actions\\http_post_action_step","data":"{\"url\":\"http:\\\/\\\/localhost:8000\\\/tl4arbtl\",\"httpheaders\":\"Content-Type: application\\\/json\\r\\nAccept: application\\\/json\",\"httpparams\":\"action=course_completion&course[0]={course_id}&course[0]={course_shortname}&user[0]={user_id}&user[1]={user_username}&user[2]={user_firstname}&user[3]={user_lastname}\",\"jsonencode\":\"1\",\"stepdesc\":\"HTTP Post\",\"typedesc\":\"Action\"}","steporder":"4"}},"moodleversion":"2018083100","pluginversion":"2018082401"}