Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

As a user / future participant I will receive a second email the day before the event to remind me. #276

Closed
2 tasks
QuincyLarson opened this issue Nov 30, 2019 · 35 comments
Assignees
Labels
Email Roadmap This is an issue/feature that is on the road map for the future

Comments

@QuincyLarson
Copy link
Contributor

QuincyLarson commented Nov 30, 2019

Before we close this we need to:

  • Finalize the text (it currently has a few placeholders)
  • Write some tests, since we've already broken it once when we updated the DB schema.
@QuincyLarson QuincyLarson changed the title Text for automatic emails notifying participants of subsequent events Text for: As a future participant I will receive a second email the day before the event to remind me. Nov 30, 2019
@allella allella changed the title Text for: As a future participant I will receive a second email the day before the event to remind me. Text for: As a user / future participant I will receive a second email the day before the event to remind me. Dec 15, 2019
@allella
Copy link
Contributor

allella commented Feb 17, 2020

@Zeko369 @timmyichen @vaibhavsingh97 @jacobbogers @eolculnamo2 we'll get some text for this one and #275 but @emred2700 asked about an email template language and I wondered what direction we'd go on the local email templates.

We talked about using nodemailer over SMTP on #146 and #283, but I didn't see a specific template package and perhaps there's one already baked into Nodemailer.

A quick search suggestions you can select a Nodemailer template package like email-templates.

The choice of email template will define the markup of the text we generate and the location of the local template files.

Is Node mailer definitely the package for sending?
Which templating package, if any, is needed or suggested?

@Zeko369
Copy link
Member

Zeko369 commented Feb 17, 2020

The issue of templates was already raised by me and we agreed to use plain text emails in the MVP

@Zeko369
Copy link
Member

Zeko369 commented Feb 17, 2020

To answer other question. Yes we're using nodemailer to send emails, we'll maybe add "mailgun" or "mailchimp" "config templates" for it, so it's easier to integrate with those services.

@allella
Copy link
Contributor

allella commented Feb 17, 2020

Thanks I forgot about #290. So, just plain text in nodemailer, but if we need to insert dynamic pieces, like unique hashes to opt out of emails, then are those going to be hard coded text strings in the code, or would we still be using a template file with placeholders variables that will be merged in?

It seems any of these 3rd party mail services should take a plain-text message as part of their SMTP, which I think is part of the SMTP spec, so perhaps the config templates are a post-MVP feature.

@emred2700 if you have any old reminder emails from event services, like Meetup.com, Facebook, or whatever is popular where you are, then how about posting a screenshot of those to seed the conversation on text. I'll try to do the same.

@Zeko369
Copy link
Member

Zeko369 commented Feb 17, 2020

We can just use a template literal to create a email "function" instead of using HTML templates for now.

const email = (user, link) => `
Hello ${user.name},

Go to ${link},

Bye
`

@allella
Copy link
Contributor

allella commented Feb 17, 2020

Thanks. I was wondering if there as a plain-text template since folks usually don't like to mix content and logic. Though, for MVP what you posted looks expedient.

@Zeko369
Copy link
Member

Zeko369 commented Feb 17, 2020

The email-templates lib you mentioned can do that, but if we're going to setup a templating library I think that we should go all the way and setup HTML rendering

@Zeko369
Copy link
Member

Zeko369 commented Feb 17, 2020

And since we're going to be sending 4 different emails in the MVP (or even less) it's ok to just use simple function as templates for now.

@allella
Copy link
Contributor

allella commented Feb 17, 2020

Google Calendar reminders (below) are actually pretty close to plain-text and might be a better model for us than Meetup's rich reminders. Though, I only have organizer reminders in my trash so I'm not sure what the Meetup or Facebook reminders look like.

@allella
Copy link
Contributor

allella commented Feb 17, 2020

image

@MihirSomani
Copy link

I'm not the expert when it comes to managing SMTP servers, but I've some experience with several open-source mailing libraries. The problem I've majorly faced running my own SMPT server is: emails don't get delivered reliably, or even if they do, popular email applications (eg: Gmail) automatically move them into the SPAM folder. I've ended up just using 3rd party services like Twillio which takes care of those issues for me.
However, I understand that this might not be an option since we would like to avoid any paid services.

@Zeko369
Copy link
Member

Zeko369 commented Feb 20, 2020

@MihirSomani you misunderstod us, we're not talking about hosting our own SMTP server, rather using something like mailgun or mailchimp for that service, and connecting it to them via SMTP

@MihirSomani
Copy link

I was just reading @allella comments on this and he mentioned similar issues. But since you'll be using a 3rd party service, those issues won't be much of a problem!

@allella
Copy link
Contributor

allella commented Feb 20, 2020

Yes, all of the popular services should work with SMTP to relay mail from the Chapter instance.

Since SMTP is a protocol, this will avoid the owner of the instance having to configure the server to use a specific plugin for their transactional email service of choice. For example, SES would require a custom nodemailer plugin, in addition to nodemailer.

For the MVP, we should be able to ask for an SMTP server hostname and user / password credentials (example). That would be saved in the instance's environment variables / configuration, like in a local .env file.

@davidals
Copy link
Contributor

davidals commented Mar 3, 2020

Has there been any decision/discussion on how the scheduling will be handled?

We could either have something like https://github.com/kelektiv/node-cron , or another service responsible only for querying the DB for "events happening tomorrow" and sending out the e-mails.
Or some lightweight task scheduler using the database.

@allella
Copy link
Contributor

allella commented Mar 3, 2020

Good question @davidals

@Zeko369 and @timmyichen have been working on most of the node app, so I'm pinging them for input on who we might trigger reminder emails and other schedule tasks.

@Zeko369
Copy link
Member

Zeko369 commented Mar 4, 2020

@davidals great idea, I think that this should be part of the MVP.

But there are some problems with this, so first we said that for simplicity we'll host this on Heroku and if we use node-cron we'll essentially be running a blank Dyno which will cost a lot of money. Same goes for a more complicated job scheduler which we certainly don't need for the MVP. Since we're already heavily invested in the Heroku Ecosystem for the MVP (Heroku Postgres, Heroku Dynos for hosting, using their easy to setup ENV configs), we could simply use their built in scheduler (which is really limited about what we can change, giving us an ability to run it every 10minutes, 1hour or 1 day but we can set it to run daily at midnight for example, which is what we need) to start a one-off dyno to check if it needs to send any emails and do so. By doing this we'll greatly reduce the price of hosting on Heroku and make it simpler of us to setup.

I'd be really happy if you'd work on this with us, what do you think about this heroku-scheduled idea?

Since someone somewhere will probably try to run it on their own server, they can easily just create a "regular" cron job that executes our script at midnight. (we can provide a simple snippet for them)

Later we can defiantly add something like Bull, but that will require us to use redis, which is another dependency that I think we can live without for the MVP.

@Zeko369
Copy link
Member

Zeko369 commented Mar 4, 2020

Also this greatly exceeds the scope of this issue, so I'll be opening another one about this specifically, so we can move this conversation there

@QuincyLarson
Copy link
Contributor Author

@davidals Thanks for sharing that library.

I agree with @Zeko369 that we should just use Heroku's native chron job tool (Scheduler) for this for now.

@allella
Copy link
Contributor

allella commented Mar 10, 2020

@Zeko369 the Heroku approach sounds good to me with the caveat you mentioned about the script that Heroku is calling can also be called by a Linux crontab.

@allella
Copy link
Contributor

allella commented Mar 10, 2020

Here's a rough first draft to get ideas moving on the text an options we might include in an event / rsvp reminder email.

Reminder for {events.name}

When: {events.start_date} to {events.end_date}
Where: {venues.name}
Event Details: [URL to the event page, like https://{instance domain name}/chapters/:chapterId]

- Cancel your RSVP: [URL to the event page, like https://{instance domain name}/chapters/:chapterId/events/:id]
- Attend the event, but turn off notifications for only this event: {URL to unsubscribe, like https://{instance domain name}/rsvp/unsubscribe/:user_id/:event_id/{a unique hash value to prevent 3rd party tampering}]
- More about {chapters.name} or to unfollow this chapter: [URL to chapter page, like https://{instance domain name}/chapters/:chapterId]

----------------------------
You are receiving this email because you previously opted-in to at the time of your RSVP.

See the options above to change your notifications.

@allella
Copy link
Contributor

allella commented Mar 10, 2020

Thinking through this process brought up the point that the locations don't have a street address or a URL in the schema. So, it's not clear with the current schema how someone would know where the event is located since #72 and #75 discussed, but did not include, address or geocoding.

Also, @ceciliaconsta3 @madaleneaza-design are there any MVP accessibility items to address on emails like this notification? For MVP we're doing text only emails for simplicity.

We are not immediately entertaining localization or internationalization for the MVP, but should we follow any standards with the date format or other parts of the email?

@allella
Copy link
Contributor

allella commented Jun 25, 2021

I wanted to add the notes below since his email will likely include some options to allow members to unfollow or unsubscribe a type of notification or the entire chapter.

The previous conversations about following / unfollowing a Chapter and unsubscribing from emails should provide good context on the type of links and privacy settings we imagined to make for easy opt-in and opt-out.

That conversation also goes into interfaces on the website and name of buttons, type of buttons and such.
For the emails, we also touched slightly on the security aspects of allowing members to unsubscribe or opt-out without needing to login. For that, something like a secure / unique hash was discussed. Whether that anonymous / hash ideas is the correct approach, or easy to do is up for debate, but I thought to mention it.

The core of those email and UI opt-in / out conversations were on #107 and I tried to summarize the conversation at a few points, like:

#107 (comment)
#107 (comment)
#107 (comment)

@allella allella added Good First Issue This issue is beginner friendly! It shouldn't take much experience to get up and running. and removed Beginner Friendly labels Aug 19, 2021
@allella allella mentioned this issue Aug 19, 2021
1 task
@Ravichandra-C
Copy link
Contributor

Ravichandra-C commented Oct 2, 2021

@ojeytonwilliams @allella , Could you please provide some information on how this should be implemented? All the discussion in this issue seems to be suggesting to use Heroku's scheduler. Could you please let me know your thoughts on that?

Can we not create another docker container and run a scheduling job in it using a package like node-cron?

@allella
Copy link
Contributor

allella commented Oct 3, 2021

I'm not sure of the best solution.

One method that some CMS, like Wordpress, use is to add items to a queue and have the jobs scheduled at the end of normal web traffic. However, that's not the idea solution as it can slow down normal traffic.

I suspect there would be some sort of queue involved and then a trigger for it, like the Heroku scheduler or cron job, but I'll defer to Oliver, @Zeko369 and others about the best approach.

@ojeytonwilliams
Copy link
Contributor

I'm not 100% sure either, but Fran makes a good argument for using Heroku's scheduler for the MVP (cost, simplicity and we're already considering Heroku in general). The main discussion is over here: #359

@allella
Copy link
Contributor

allella commented Dec 23, 2021

Emails will be sent only to members where the {event_users.subscribed} is true and their {rsvp status} is confirmed for the event. Post-MVP, we'll need to figure out what to do with people on the wait list.

Email Title: Upcoming Event Reminder for {event.name}

[{events.name}](Link to the event page, like https://{instance domain name}/chapters/{chapters.id}]) organized by {chapters.name} is happening soon.

Your RSVP Status: {rsvps.name} | [Need to change your RSVP?](link to the chapter page, like https://{instance domain name}/chapters/:chapterId/events/:id, where there's an option to change the RSVP)

When: {events.start_at | formatted as Day of the Week, like Friday}, {events.start_at | formatted as month, day, year, like December 15, 2021} from {events.start_at | formatted like 4:30 PM} to {events.end_at | formatted like 6:00 PM} ({timezone of the event})

Where: {venues.name} | {venues.address} {venues.city}, {venues.region} {venues.postal_code}

(post-MVP feature) Add to My Calendar: [Google](URL for Google) | [Outlook](URL for Outlook) | [Yahoo](URL for Yahoo) | [iCal](URL for iCal)

This email was sent to {users.email} by {chapters.name} | {chapters.city}, {chapters.region} {chapters.country}
Copyright © {current year in YYYY format} {Organization}. All rights reserved.


Unsubscribe Options
- [Attend this event, but only turn off future notifications for this event](Unsubscribe link, like https://{instance domain name}/rsvp/unsubscribe/{users.id}/{events.id}/{unsigned JWOT token} which will set the appropriate {event_users.subscribed} to false when clicked)
- Or, [stop receiving all notifications by unfollowing {chapters.name}](Unsubscribe link, like https://{instance domain name}/chapter/unsubscribe/{users.id}/{chapter.id}/{unsigned JWOT token} which will set the appropriate {chapter_users.subscribed} to false when clicked)

[Privacy Policy](link to privacy page)


@allella allella mentioned this issue Apr 13, 2022
9 tasks
@allella allella changed the title Text for: As a user / future participant I will receive a second email the day before the event to remind me. As a user / future participant I will receive a second email the day before the event to remind me. May 14, 2022
@ojeytonwilliams
Copy link
Contributor

I removed the MVP label because we're planning to integrate with Google Calendar. As a result this should end up being a fallback for users that don't use Google Calendar and so is not 100% necessary for a viable MVP.

@allella
Copy link
Contributor

allella commented Jun 8, 2022

@ojeytonwilliams you added a task to "Finalize the text". Is that more of a technical thing, or does the suggested text / template above need more discussion?

@ojeytonwilliams
Copy link
Contributor

@allella no, that text looks good to me. It's just that we still have text like this in the reminder emails:

[${event.name}](Link to the event page, like https://{instance domain name}/chapters/${event.chapter.id}]) 

For this to be done, those placeholders would need to generate the correct links.

@Johnny01232003
Copy link

I'll be working on this issue.

@ojeytonwilliams
Copy link
Contributor

Thanks @Johnny01232003, that would be great. If you have any questions, feel free to ask here or in our chat

@Johnny01232003
Copy link

Thanks @Johnny01232003, that would be great. If you have any questions, feel free to ask here or in our chat

Actually, we are going to start off with something a little easier with the UI components #1143. Thank you @ojeytonwilliams for the resources and fast response though!

@ojeytonwilliams
Copy link
Contributor

You're very welcome! Thanks for helping out :)

@ojeytonwilliams
Copy link
Contributor

This is another thing that's currently covered by the Google calendar integration. Our own scheduling code does exist, but until we keep the number of emails under control, #1670, I'd rather keep that turned off.

We should revisit this post MVP, though.

@ojeytonwilliams ojeytonwilliams added Roadmap This is an issue/feature that is on the road map for the future and removed Good First Issue This issue is beginner friendly! It shouldn't take much experience to get up and running. labels Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Email Roadmap This is an issue/feature that is on the road map for the future
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants