Summary
This script is an email trigger that evaluates whether the negative pregnancy test question is answered with ‘No’. It determines which environment the script is running on (Staging or Production) and sends out the email to that predetermined list having a unique subject line for each environment. Staging includes the design/test/approve environment whereas Production is the live/production environment. Please consider the existence of training sites on production.
Note: -'shouldReconcile' is set to ***false*** so that the script will not be evaluated again upon use of the reconcile utility. This script will execute only when data entry is done.
Note: In order for the line breaks to be recognized within your body paragraph text, please add two spaces after the newline character (\ln ).
Script
<script scriptId="SCR_preg_email"> <body> <s:if> <s:and> <s:isSet/> <s:eq> <s:stringPath path=".pregresscr:value" type="string"/> <s:string value="N"/> </s:eq> </s:and> <s:email> <s:to> <s:if> <s:eq> <s:environment/> <s:string value="Staging"/> </s:eq> <s:list> <s:string value="emailtriggers@fountayn.com"/> <s:string value="Add email addresses here"/> <s:string value="Add email addresses here"/> </s:list> <s:list> <s:string value="dtnotify@fountayn.com"/> <s:string value="Add email addresses here"/> <s:string value="Add email addresses here"/> </s:list> </s:if> </s:to> <s:from> <s:string value="no-reply@fountayn.com"/> </s:from> <s:subject> <s:if> <s:eq> <s:environment/> <s:string value="Staging"/> </s:eq> <s:concat> <s:string value="TESTING/UAT "/> <s:string value="[V01-TRSA-101] Positive Pregnancy Test Reported: "/> <s:string value="Site # ["/> <s:stringPath path="/visit0scrn/enroll.subsite:displayValue" /> <s:string value="]"/> </s:concat> <s:concat> <s:string value="[V01-TRSA-101] Positive Pregnancy Test Reported: "/> <s:string value="Site # ["/> <s:stringPath path="/visit0scrn/enroll.subsite:displayValue" /> <s:string value="]"/> </s:concat> </s:if> </s:subject> <s:body> <s:concat> <s:string value=" A subject has reported a positive Pregnancy Test. Please see the following for more information."/> <s:string value="\n Site: "/> <s:stringPath path="/visit0scrn/enroll.subsite:displayValue" /> <s:string value="\n Subject: "/> <s:stringPath path="/visit0scrn/enroll.subnum:displayValue" /> <s:string value="\n Visit 0 - Screening and Enrollment"/> <s:string value="\n Was the pregnancy test NEGATIVE? "/> <s:stringPath path=".pregresscr:displayValue" /> <s:string value="\n Date of pregnancy test: "/> <s:stringPath path=".pregdt:displayValue"/> </s:concat> </s:body> </s:email> </s:if> </body> <target action="update" shouldReconcile="false" typeId="pregresscr" when="after"/> </script>
Need more help?
Please visit the Fountayn Contact Information page.