micromasters icon indicating copy to clipboard operation
micromasters copied to clipboard

Create models to support sent-mail views

Open gsidebo opened this issue 8 years ago • 2 comments

Sent-mail views: #808

Some details that should guide the design of these models:

  • For this version of Micromasters email, messages can only be sent to an entire set of users that match a search query. We will need to keep track of the individual recipients due to the 'send to new recipients' requirement, but the only way to send an email in this version is to have a search query. For each sent email, we'll need some way to store both the recipients and the parameters of the search query that yielded the recipients
    • We should be careful with parameters like page number. The "Email Learners" (et al) button should not limit the recipient just to a current page - the entire set of learners that match the query should receive the email. Otherwise the 'send to new recipients' feature would effectively be broken.
  • We'll need to store the email message body as well as the subject line to enable resending
  • We want to be able to get certain stats about sent mails from Mailgun (open rate, etc). Our model for sent emails should include some reliable reference to the message as it was sent in Mailgun.
  • For the 'send to new recipients' requirement, we are going to create a new record for a sent mail. There's no requirement to 'group' individual sends of a message
  • The point of 'Send to new recipients' Is essentially going to calculate a set difference between the users that currently match the search query and the previous recipients
    • 'Send to new recipients' will only be available when a message in the sent-mail view is expanded. We won't need to calculate these new recipients on page load

gsidebo avatar Aug 10 '16 20:08 gsidebo

We will still be storing data collected from Mailgun on this object, i.e. external_message_id, delivery_count and open_rate?

pdpinch avatar Aug 10 '16 20:08 pdpinch

Updated the notes re: message id. w/r/t delivery_count and open_rate, that is information we can just fetch directly from Mailgun. it makes some sense to do it that way since those numbers change over time - asking the Mailgun API for those stats will make them real-time

gsidebo avatar Aug 10 '16 20:08 gsidebo