Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Conversation

@brianlovin
Copy link
Contributor

@brianlovin brianlovin commented Dec 6, 2017

THE BATTLE HAS BEEN WON AGAINST ASYNCHRONOUS CODE

  • handles image messages
  • handles deleted messages
  • dynamic subject lines and email preview text based on the people and conversations involved in the email
  • better visual differentiation of threads and replies
  • more clear calls to action - aligns visuals with other mention and new thread emails

Deploy steps:

  • take down hermes
  • take down athena
  • update email template in postmark
  • deploy hermes
  • alias hermes
  • deploy athena
  • alias athena
  • deploy iris
  • alias iris

Closes #2138

Deployment notes

Requires deployments to iris + hermes

Run database migration?

YES/NO

Release notes

We improved the design of our notification emails for new replies in your conversations to make it easier to quickly preview and catch up on what people are saying while you're away.

superbryntendo
superbryntendo previously approved these changes Dec 7, 2017
@mxstbr
Copy link
Contributor

mxstbr commented Dec 7, 2017

This is such a massive change, do you have a test plan? What should we be looking at?

@brianlovin
Copy link
Contributor Author

To be honest I don't know how to test any these changes besides doing it locally. We don't have a way right now to test workers, since the second we deploy a new worker it will start pulling off the queue.

The key changes of this PR are in Athena - whenever a user's timeout is completed, I take each thread and do one last combover to remove deleted messages. This means that if a user deletes their message in the ~5min time period since they posted it and notifications go out, people won't get notified.

Additionally, I've made it so that the emails handle image messages instead of just showing an imgix url in the email.

And the last big change is the subject/preview text for the emails. So before it would say:
"You've got new replies on Spectrum"
with preview text:
"The conversation has continued while you were away"

Now that subject/preview is dynamic based on how many threads and unique people are in the notification. So for example:

1 user : 1 thread in the email:
Subject: "Brian Lovin replied in Thread Title'
Preview: "View your conversations with Brian Lovin"

1 user : N threads in email:
Subject: "Brian Lovin replied in N conversations"
Preview: "View your conversations with Brian Lovin"

N users : 1 thread:
N === 1
Subject: "Brian Lovin and N other person replied in Thread Title'
Preview: "View your conversations with Brian Lovin and 1 other person'
N > 1
Subject: "Brian Lovin and N other people replied in Thread Title'
Preview: "View your conversations with Brian Lovin and N other people'

N users : X threads:
Subject: "Brian Lovin and N other people replied in X conversations"
Preview "View your conversations with Brian Lovin and N other people"

Reviewing those now, maybe the preview text isn't totally perfect.

The goal of all this is to have my dynamic email subjects/previews to draw people in. Using people's names, thread titles, and providing context about volume should all help here.

And the last thing in the PR is visual updates to bring this email's style in line with our new thread and mention notification emails.

Do you have any suggestions for how to further test this ?

@mxstbr
Copy link
Contributor

mxstbr commented Dec 7, 2017

I meant locally haha, from all those tiny code changes I wasn't 100% sure what I was looking for! Will test this thoroughly locally once you make the subject lines perfect and this is ready to be shipped 💯 (I guess tomorrow)

We should add automated e2e to our workers in the future.

@brianlovin
Copy link
Contributor Author

This is good to test locally now - I'll probably just tweak the copy on the preview text to something more compelling than a loose replication of the subject line. Thanks!

@brianlovin
Copy link
Contributor Author

Okay updated the preview. Format will now look like:

1 user : 1 thread in the email:
Subject: "Brian Lovin replied in Thread Title'
Preview: "View {NEW_MESSAGE_COUNT} new messages from Brian Lovin"

1 user : N threads in email:
Subject: "Brian Lovin replied in N conversations"
Preview: "View {NEW_MESSAGE_COUNT} new messages from Brian Lovin"

N users : 1 thread:
N === 2
Subject: "Brian Lovin and N other person replied in Thread Title'
Preview: 'View {NEW_MESSAGE_COUNT} new messages from Brian Lovin and one other person'
N > 2
Subject: 'Brian Lovin and N other people replied in Thread Title'
Preview: 'View {NEW_MESSAGE_COUNT} new messages from Brian Lovin and {N - 1} others'

N users : X threads:
Subject: "Brian Lovin and N other people replied in X conversations"
Preview "View {NEW_MESSAGE_COUNT} new messages from Brian Lovin and {N - 1} others"

SO now we have
Subject: context about people and thread
Preview: context about the replies

superbryntendo
superbryntendo previously approved these changes Dec 7, 2017
@brianlovin
Copy link
Contributor Author

@mxstbr I'll leave this open if you were wanting to test tomorrow - but will ship it at the same time as the digest PR tomorrow

@brianlovin
Copy link
Contributor Author

@mxstbr did you manage to test this today? if not no worries, I can do another round of testing on my own - would like to ship all the email stuff today if possible

@brianlovin
Copy link
Contributor Author

Finally got around to testing everything tonight - afaik this is good to go. I will merge this and ship everything tomorrow.

@brianlovin
Copy link
Contributor Author

Kk gonna start working through this merge and deploy this morning!

@brianlovin
Copy link
Contributor Author

@mxstbr did you want to take a look at any more code here, or shall i admin merge?

@brianlovin brianlovin mentioned this pull request Dec 12, 2017
1 task
Copy link
Contributor

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kinda hard to review the code here since the changes are so all over the place, didn't see anything that stuck out to me as a bug.

If you tested this locally I say let's ship it!

@brianlovin brianlovin merged commit 2459d33 into master Dec 12, 2017
@brianlovin brianlovin deleted the new-message-email-notifs branch December 12, 2017 17:09
@brianlovin
Copy link
Contributor Author

Okay everything is deployed to the workers and api. i'll be keeping an eye on everything today.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants