Last active
August 29, 2015 14:06
-
-
Save dzmitryk/ea7bcd9d77b94da83de8 to your computer and use it in GitHub Desktop.
enrolment sending script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run(args) { | |
def enrolment = args.entity | |
if (enrolment.status == EnrolmentStatus.SUCCESS && enrolment.confirmationStatus == ConfirmationStatus.NOT_SENT) { | |
def m = Email.create("Enrolment Confirmation") | |
m.bind(enrolment: enrolment) | |
m.to(enrolment.student.contact) | |
m.send() | |
enrolment.setConfirmationStatus(ConfirmationStatus.SENT) | |
args.context.commitChanges() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed. I've updated the scripts' gists to their current state.