hasgeek / funnel

Website for hasgeek.com
https://hasgeek.com/
GNU Affero General Public License v3.0
46 stars 52 forks source link

Change SMS templates to comply with the new DLT Guidelines #1741

Open djamg opened 1 year ago

djamg commented 1 year ago

According to the new DLT guidelines, an SMS template can not contain more than 2 variables (in some cases 3) and any 2 variables cannot be consecutive. This has resulted in the blacklisting of our current templates, which must be modified.

For example - The current project start notification template looks like this: {project.title} starts at {project.start_time}. {project.link} {unsubscribe_link} to stop - Hasgeek

This example contains four variables and one place with 2 consecutively placed variables.

What should the updated template look like?

jace commented 1 year ago

Our templates typically have four variable components:

  1. Context for where something happened
  2. Context for what happened
  3. A content link
  4. An unsubscribe link

This will now be reduced to two:

  1. Context for where and what, combined
  2. A single content link

To roll the unsubscribe link into the content link, we can:

  1. Use a single link in the form https://has.gy/<shortlink>/<unsubscribe_token>. The split form allows keeping notification metadata separate from the content shortlink, and can be used to insert a banner for managing notification preferences
  2. Use only a content link in the form https://has.gy/<shortlink>. There is still some context for the notification in the utm_source tag. However, one click unsubscribe will no longer be possible.
  3. Use a static link https://bye.li in the registered text. This will merely redirect to the notifications page, and once again does not offer one-tap unsubscribe. It will require the user to login to see their preferences. However, we can highlight notifications that have been recently active.
jace commented 1 year ago

Candidate template for project/session starting:

Python: {project} is starting at {time}: {link}\n\nhttps://bye.li to stop - Hasgeek DLT: {#var#} is starting at {#var#}\n\nhttps://bye.li to stop - Hasgeek

This assumes time + ': ' + link fits into 30 chars. Links are in the form https://has.gy/1234 and have exactly 19 chars (in the shorter 4 char variant that we use for SMS). The separator is an additional 2 chars, leaving 9 for the time. A timestamp in the form 10:30 AM is 8 chars.

If we include an unsubscribe token in the shortlink, the math changes to 24 chars for the link, 2 for the separator, and only 4 for the time. This will force military-style time in the form …is starting at 1030: https://…

Update: Template variant with more static text:

✅Approved Python: Reminder: {project} is starting soon. Join at {link}\n\nhttps://bye.li to stop - Hasgeek DLT: Reminder: {#var#} is starting soon. Join at {#var#}\n\nhttps://bye.li to stop - Hasgeek

Update: Implemented in #1742.

jace commented 1 year ago

Options to shave some chars in the link:

  1. Use http:// instead of https://. Saves one char and redirects to HTTPS anyway. Since HSTS is enabled, the device browser will automatically translate it to HTTPS. However, there is risk of some users worrying about an unencrypted link.
  2. Drop the prefix and use a raw link as has.gy/<code>. This will need testing in multiple SMS clients to verify if such URLs are recognised.
  3. Same but use //has.gy/<code> in the hope the // is recognised as a URL
  4. Try hasgeek.com/+<code> or hasgeek.com/@<code> in the hope unprefixed .com URLs are recognised. This is a 13 char prefix, versus 14 or 15 for the fully prefixed .gy TLD.

These tests don't need registered SMS templates. A regular SMS will work.

jace commented 1 year ago

Candidate templates for project registration:

✅Approved Python 1: You have registered for {project}, scheduled for {datetime}. For more information, visit {url}.\n\nhttps://bye.li to stop - Hasgeek DLT 1: You have registered for {#var#}, scheduled for {#var#}. For more information, visit {#var#}.\n\nhttps://bye.li to stop - Hasgeek

✅Approved Python 2: You have registered for {project}. For more information, visit {url}.\n\nhttps://bye.li to stop - Hasgeek DLT 2: You have registered for {#var#}. For more information, visit {#var#}.\n\nhttps://bye.li to stop - Hasgeek

Variant 1 has three variables. If this becomes a problem, we can try a static link variant: You have registered for {project}, scheduled for {datetime}. Manage your registrations and notifications at https://hasgeek.com/account - Hasgeek

jace commented 1 year ago

Required templates by notification:

  1. [x] rsvp_yes
  2. [x] comment_reply
  3. [x] comment_proposal
  4. [x] comment_project
  5. [ ] user_password_set
  6. [x] update_new
  7. [x] proposal_received
  8. [x] proposal_submitted
  9. [x] project_starting (with and without an upcoming session timestamp)
  10. [ ] comment_report_received
  11. [ ] rsvp_no
  12. [ ] organization_membership_granted
  13. [ ] project_crew_membership_granted
  14. [ ] organization_membership_revoked
  15. [ ] project_crew_membership_revoked
  16. [ ] New: project_published
djamg commented 1 year ago

New comment notification for different document types: ✅Approved Comment reply: Python: {actor} has replied to your comment: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: {#var#} has replied to your comment: {#var#}\n\nhttps://bye.li to stop - Hasgeek

✅Approved Project: Python: {actor} commented on a project you are in: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: {#var#} commented on a project you are in: {#var#}\n\nhttps://bye.li to stop - Hasgeek

✅Approved Proposal: Python: {actor} commented on your submission: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: {#var#} commented on your submission: {#var#}\n\nhttps://bye.li to stop - Hasgeek

Unknown: Python: {actor} replied to you: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: {#var#} replied to you: {#var#}\n\nhttps://bye.li to stop - Hasgeek

djamg commented 1 year ago

Update notification: Python: Update in {project}: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: Update in {#var#}: {#var#}\n\nhttps://bye.li to stop - Hasgeek

The above text contains consecutively placed variables that aren’t permitted according to the DLT guidelines. Here is an updated version Python: {project} has an update: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: {#var#} has an update: {#var#}\n\nhttps://bye.li to stop - Hasgeek

✅Approved New update notification Python: There is an update in {project}: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: There is an update in {#var#}: {#var#}\n\nhttps://bye.li to stop - Hasgeek

djamg commented 1 year ago

Proposal Notification:

✅Approved Proposal received: Python: There's a new submission from {actor} in {project}. Read it here: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: There's a new submission from {#var#} in {#var#}. Read it here: {#var#}\n\nhttps://bye.li to stop - Hasgeek

✅Approved Proposal submitted: Python: {project} has received your submission. Here's the link to share: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: {#var#} has received your submission. Here's the link to share: {#var#}\n\nhttps://bye.li to stop - Hasgeek

djamg commented 1 year ago

- Hasgeek is not required if the brand name is registered with the template because it will get appended to the template message.

It is not clear when to attach the brand name to a template. It depends on the customer service agent.

jace commented 1 year ago

Maybe we just stop putting it in our text and let VILPower decide whether to append. We started doing that only because Airtel demanded it.

jace commented 1 year ago

New template for MNRL notice (related: #1786 and #1810):

Hi {user}, your number has appeared in the Mobile Number Revocation List and has been removed from your Hasgeek account for your safety. If this is wrong, mark it active at {url}. See https://mnrl.trai.gov.in/ for details.

djamg commented 5 months ago

Project/Event Starting Notification:

✅Approved Default 10-minute reminder template: Python: Reminder: {project} is starting soon. Join at {link}\n\nhttps://bye.li to stop - Hasgeek DLT: Reminder: {#var#} is starting soon. Join at {#var#}\n\nhttps://bye.li to stop - Hasgeek

✅Approved Template with venue: Python: {account} has an in-person event tomorrow at {venue}. Details here: {url}\n\nhttps://bye.li to stop - Hasgeek DLT: {#var#} has an in-person event tomorrow at {#var#}. Details here: {#var#}\n\nhttps://bye.li to stop - Hasgeek

✅Approved Template with location: Python: Reminder: {#var#} has an in-person event tomorrow in {#var#}. Details here: {#var#}\n\nhttps://bye.li to stop -Hasgeek DLT: {#var#} has an in-person event tomorrow in {#var#}. Details here: {#var#}

jace commented 5 months ago

We need to change all our templates to have a single link, to allow for link preview in SMS apps. This affects the unsubscribe link:

  1. Earlier we had direct unsubscribe links, but this required an extra DLT variable. The current https://bye.li is indirect as it requires login, which is not user friendly. This is causing people to report unwanted messages as spam instead.
  2. We can include an unsubscribe token with the shortlink itself using the method described in #1914.