Draw invitation e-mail contents are dependent on the runtime state of the draw
Update 2019-03-11
We have identified the root cause, steps to replicate:
- Create draft draw with intent unlocked
- Proceed to intent selection
- Immediately lock intent
Expected: All student draw invitation e-mails are sent with the intent (not group formation) language
Actual: All student draw invitation e-mails sent after the intent was locked have the group formation language
The problem is that we pass a draw into the mailer method for the draw invitation e-mail and then pull its intent_locked
attribute to determine the specific language to include in the draw. However, this means that we're using the intent_locked
value at runtime, not the intent_locked
value when the e-mail was queued to be sent.
Things to fix:
-
Pass draw.intent_locked
directly into the mailer method as a parameter and use it to determine the language. -
Check all other e-mails for conditional view logic and pass those attributes in directly -
Fix the period outside of the conditional logic in the draw invitation e-mail view (this causes a double period).
Original Description
Hello,
I just locked intent, but did NOT start group formation, and the system sent the below e-mail … could this be checked out? I am afraid that this is going to create much confusion, since group formation does not open until after the recess. Thanks!
[forwarded draw invitation e-mail, subject: "The housing process has begun" with the text "You may now create or join housing groups if you will be living on-campus."]
Context:
All three draws in that college are in the intent phase. I just searched the codebase and the only time we send the e-mail (StudentMailer#draw_invitation
) is through the DrawActivator
. Draw intent locking hits the draws#update
action, and there's no reason why that should have resulted in e-mails being sent. That said, I logged in to the O365 account we're using to send e-mails and it looks like it did send that e-mail to many students in the college (not sure if it was restricted to just one draw or not) - hopefully we'll get more information to debug.