Menu

One abandoned-checkout email, seven reasons not to send it, and a Redis key that fails closed
📰

One abandoned-checkout email, seven reasons not to send it, and a Redis key that fails closed

DEV Community: typescript·Daniel Pertu·about 15 hours ago
#A6jwKcqz
#devtotypescript#devto#dev#email#checkout
Reading 0:00
15s threshold

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".…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.