Somebody opens CogniPrep's checkout, gets as far as the card field, and closes the tab. An hour later Stripe sends checkout.session.expired , and we send one email.
The email is the boring part. Everything around deciding whether to send it is not.
It is a reminder, and the module says so first
The file opens by defining itself by what it is not:
* - A plain reminder of what they were buying and a link back to it. No * discount code, no countdown, nothing that pretends the offer is ending. * - Sent only to a known account with email notifications on, and only when * they have not bought the product (or anything else) since starting that * checkout. The account-wide unsubscribe applies, as on every other email. * - At most one per user per 14 days, whatever they abandon.
Enter fullscreen mode
Exit fullscreen mode
Writing the constraints at the top of the module is cheap and it settles arguments later. The temptation with this email is always the same: add 10% off, add "your cart expires tonight".…