Move sending of voucher emails to async
Problem
In a failed provision for a SaaS purchase, it looks like an invalid grant error has prevented the purchase from being synced to GitLab.com (see this comment). While the customer was notified about the purchase, we suspect that the voucher email to SFDC was not send because of a missing SFDC contact. When the contact was attempted to be created, the invalid grant for the SFDC client raised an exception which resulted the CreateOrderService
to fail and prevented the purchase from being synced to GitLab.com.
Proposal
-
✅ (completed in Remove non-primitive types from mailers (#9237 - closed)) Sending the voucher emails async from the the actual provisioning to make the sending retryable if needed and allow the provisioning to succeed. - Pass the timestamp when the customer notification email was sent could be passed into the worker/job which should send the voucher email.
- Add this timestamp to the email body for proof of delivery tracking purposes.
Result
Continue with the provisioning even if there's an invalid grant for SFDC and make the voucher email sending retryable.
Edited by Corinna Gogolok