vanderbilt-redcap / email-alerts-module

Module to send customized emails alerts after a form/survey is completed to one or several recipients.
MIT License
2 stars 9 forks source link

sendEmailAlert sometimes fires too early #12

Open pbchase opened 5 years ago

pbchase commented 5 years ago

The sendEmailAlert sometimes fires early denying other modules the chance to write data need for rules. We encountered this problem when email_alerts was configured to fire on a form wherein another module was writing a field that email_alerts need for its rules. Email_alerts does use the delayModuleExecution function to allow it to run later than other modules, but it calls it after the rules are tested. This caused email rules to fail before the other module wrote the data that would satisfy them.

We have a fix for this problem in a pull request I'll submit shortly.

pbchase commented 5 years ago

PR #13 provides a fix for this issue.

jasonlones commented 5 years ago

Thanks Philip! I am hoping this will resolve an issue we've had with Email Alerts since around 2.0.2. When using the Save Survey to PDF ExMod in conjunction with Email Alerts, Email Alerts would fire before the Save Survey module finished.

pbchase commented 5 years ago

Yeah, that sounds like it would be fixed by this PR. Glad I could help.

jasonlones commented 5 years ago

This doesn't seem to have helped in our case. We are still experiencing 'EmailAlerts' firing before 'SaveSurvey'.