episphere / connect

Connect API for DCEG's Cohort Study
10 stars 5 forks source link

Create email categories for unsubscribes #720

Open depietrodeanna opened 1 year ago

depietrodeanna commented 1 year ago

Hi Jessica, the following categories are the ones we'll want to create as unsubscribe "buckets." I've organized each that we have in the dashboard currently into one of the below. We only have two groups for unsubscribes so far, with more to come likely in the future. The study activities are essential comms and participants cannot unsubscribe from those. When the functionality is available, we will have to develop a message that pops up when someone tries to unsubscribe to let them know those comms cannot be unsubscribed from, but they can update their contact info preferred email and/or contact the CSC.

Let me know if you have nay questions:

  1. Newsletter communications/study updates, acknowledgement emails: can unsubscribe from these communcations: category name: "newsletter"

  2. Study activities: cannot unsubscribe from these communications: category names: "Baseline Menstrual Cycle Survey Reminders" "Baseline Research Biospecimen Survey Reminders" "Cannot Be Verified Notification" "Data Destruction Reminders" "HF Baseline Biospecimen Scheduling Invitation" "HIPAA revocation reminders" "HP Baseline Research Biospecimen Scheduling Invitation" "KPCO baseline biospecimen invitations" "KPGA baseline biospecimen invitations" "KPHI baseline biospecimen invitations" "KPNW baseline biospecimen invitations" "UC Baseline Biospecimen Scheduling Invitation" "Verified, BL Survey Reminders" "Verified, BL Survey Reminders Backlog Pts 2nd contact" "Verified, BL Survey Reminders Backlog Pts 3rd contact" "Verified, BL Survey Reminders Backlog Pts 4th contact" "Verified, BL Survey Reminders Backlog Pts 5th contact" "Verified, BL Survey Reminders Backlog Pts 6th contact" "Verified, BL Survey Reminders New Pts 2nd contact" "Verified, BL Survey Reminders New Pts 3rd contact" "Verified, BL Survey Reminders New Pts 4th contact" "Verified, BL Survey Reminders New Pts 5th contact" "Verified, BL Survey Reminders New Pts 6th contact" "Withdrawal Reminders" "post-consent user profile reminders"

jhflorey commented 1 year ago

Hi @Davinkjohnson , @depietrodeanna I tried something for this issue

I have some ideas to use sendgrid api in connectFaas and also update something in SMDB.

Another issue that concerns me is When the functionality is available, we will have to develop a message that pops up when someone tries to unsubscribe to let them know those comms cannot be unsubscribed from, but they can update their contact info preferred email and/or contact the CSC. => I do not know how to show the pops up for particiapnt, or we have to implement the unsubscription management for participant in PWA or SMDB.

Please let me know you thoughts.

Davinkjohnson commented 1 year ago

Jessica, I think the plan you outlined seems like it should meet the requirements as defined and be pretty scalable. I'd ask that you also review it from a technical perspective with one of the other Sr developers, since it's a new area of work for us.

As for your last concern, around the pop up on unsubscribe, can you run a test where you send an email to a participant that does not have "allow unsubscribe" and try to unsubscribe anyway?

I'm thinking that SendGrid manages the unsubscribe page and we'll therefore not have much control over it, but it would be best to know for sure.

jhflorey commented 1 year ago

@Davin thanks for your feedback

Yup, Sendgrid has the page for manage suppressions https://app.sendgrid.com/suppressions/group_unsubscribes. But i was wondering how to display the pop up in email that participant received. I'll research more for the pop up on unsubscribe.

Additionally, i have an idea for unsubscribe group in SMDB. We have 2 ways to manage unsubscribe group

Then on the Create/Edit Notification Schema form in SMDB we can use the api https://docs.sendgrid.com/api-reference/suppressions-unsubscribe-groups/retrieve-all-suppression-groups-associated-with-the-user to get the list of unsubscribe groups and add a dropdown like the image below to these forms image

jhflorey commented 1 year ago

@anthonypetersen @we-ai I know you are an expert in this field, so could you please let me know your thoughts and advice.

we-ai commented 1 year ago

Based on my understanding, Sendgrid unsubcription group is not a good solution:

My suggestion is that we should maintain unsubscription info in participants table:

jhflorey commented 1 year ago

@we-ai When a participant choose to unsubscribe a letter category or even a specific email type, update data in the participant. => we will add at the end of the email an unsubscribe link to update this participant's data? This unsubscribe link could be the connectFaas api. And we won't use the sendgrid unsubscribe group features.

we-ai commented 1 year ago

I'm not sure suggestions from Opts team about where to put the un-subscrition link/button. Adding the link to the survey UIs will be easier. As an example, related structure in participants data can be:

"query.notificationsUnsubscribed": {
  "newsletter": true, 
  "a1a482cd-2b13-4d6b-a1fd-4d397599d565": true,
}
jhflorey commented 1 year ago

Yes, I think we can put the link at the end of the email body.

anthonypetersen commented 1 year ago

Thoughts...

If SendGrid has functionality to maintain unsubscribe information for us, I think it's better we try to use that versus building / maintaining logic in our code base assuming it's not inconvenient to integrate with SendGrid. I'm not opposed to adding a field in the notificationSpecifications table about allowing to unsubscribe if that can actually drive logic within SendGrid. I would prefer that we send SendGrid an unsubscribe group name based on details about the notification that we already have. Warren brings up a good point though about changing emails. If SendGrid has an API where we can see what unsubscribe groups an email is apart of as well as add emails to an unsubscribe groups, we could easily add logic to our change email functionality where the new email would get added to the same unsubscribe groups as the old email.

In general, my thoughts on the subject can be best summarized as "Let's not try to re-invent the wheel if we don't have to. If possible we should try to rely on services we already use that are completely focused on solving this problem as opposed to trying to solve it ourselves."

jhflorey commented 1 year ago

Jessica, I think the plan you outlined seems like it should meet the requirements as defined and be pretty scalable. I'd ask that you also review it from a technical perspective with one of the other Sr developers, since it's a new area of work for us.

As for your last concern, around the pop up on unsubscribe, can you run a test where you send an email to a participant that does not have "allow unsubscribe" and try to unsubscribe anyway?

I'm thinking that SendGrid manages the unsubscribe page and we'll therefore not have much control over it, but it would be best to know for sure.

Hi @Davinkjohnson, i noticed that Sendgrid also supports Custom Unsubscribe Links where participants click on the link they will open our page for updates their informations. I believe it meets with "Study Activities Communications" which do not allow unsubscribes but have the option for participants to update their contact information as Deanna metioned When the functionality is available, we will have to develop a message that pops up when someone tries to unsubscribe to let them know those comms cannot be unsubscribed from, but they can update their contact info preferred email and/or contact the CSC.

jhflorey commented 1 year ago

Hi @Davinkjohnson @depietrodeanna @anthonypetersen @we-ai. Here is the proposal for this issue . Please review it and give me your thoughts.

jhflorey commented 1 year ago

Please use this link https://nih.app.box.com/file/1324474977228

sonyekere commented 9 months ago

@jhflorey, can this issue be closed?