Hi, things are really picking up at my platform for automated gifting (https://www.gifts-done.com). I've been handling most communications one off (besides a few transactional emails). However, I am not sure how to best track communications.
I'll give my particular use case. We have users and suppliers. Both perform actions on the site and need to be informed when other things happen. For instance, when you join as a user or you are accepted as a supplier, you get a welcome email. When a supplier finishes a gift, the user gets an email with the details. When a gift date is coming up, we send emails to verify that the address has not changed. When the supplier matches a gift and gets a request to complete it, we send an email.
I don't think I need to track all of these emails, but there are some that make sense to track. I think it would be good to track emails that go out based on time (we sent the 2 months no action email, for example) and ones that start a contractual obligation (the supplier is assigned a gift). So far, I've been keeping track of these on paper by bcc-ing myself on each mailing, but things are growing (YAY!) and it is definitely not scalable.
I've drawn up (on paper) a few approaches, and I think there are two that are most plausible, but neither seems perfect. First, I could add a sub-document to the user and supplier schema that is "email" which tracks the date and either content or type of message. Second, I could create another communications schema that tracks each message sent (role: user/supplier, date, type of email, content).
I'd love to hear how you handle tracking communication with your users/customers - even if your project is much different than mine. TIA.
Emails table with user_id/supplier_id, date, type, data for the transactional type messages. That'll track whats been sent and you can do a join on the user and that table for entries of type x and user creation date < some time to determine if you need to send a new time based email.