Jump to content

sending email reminders


jploch
 Share

Recommended Posts

Hey folks,
I am working on a client website, which lists some events. Events are just pages and each event has a date.
Now the client wants a solution, where people could click a button for each event to put it on a "reminder list". After they collected all the events they have interrest in, they can enter an email and get a message a day before each event happens.

Since I never had the need to develop something like this before. Is there someone who can share a good approach to this? 
I worked with FormBuilder before and there is also ProMailer (which I never used before), but not sure if that would help here. I also I took a look at WireMail Class which seems quite easy to use.

I think the website runs on a shared hosting server, so not sure if the server could even handle it. But I could talk to the client to upgrade I guess.

My approach would be like this:

  1. The email will be saved to each event page the person was interested in (maybe each event page has a field for this, where multiple emails could be stored). These Emails will not be seen by regular guest users. There will propably have to be a verification of some kind to prevent spam?
  2. There need to be some script/cronjob that checks if an event will happen soon (this seems complicated). Then an email will be send to every email that is accociated with that event.
  3. To comply to GDPR laws, the emails have to be deleted after the notification was send. (The client would like to keep them for future newsletter stuff, but than a unsubscribe button in the email isneeded).

Any ideas or feedback is welcome. Thx in advance!

Link to comment
Share on other sites

1 hour ago, jploch said:

There need to be some script/cronjob that checks if an event will happen soon (this seems complicated)

Why do you think that? This is just using PW selectors and maybe comparing dates ? 

Also sending mails is not complicated (using WireMail for example as you already mentioned). The complicated parts are IMHO:

  • subscription management (what happens if ... and what if ... and so on ...)
  • mail deliverability (not too hard but you need to be careful)
  • mail layouts (responsive, different mail clients etc)

ProMailer can help for subscription management I guess and for deliverability the easiest solution is to use some transactional mail provider. For layout you can have a look at something like MJML...

  • Like 1
Link to comment
Share on other sites

@bernhard thx for your quick reply!

2 minutes ago, bernhard said:

Why do you think that? This is just using PW selectors and maybe comparing dates ? 

Maybe I am thinking about it the wrong way, but how would the script be triggerd if not with a cronjob or something? How/when would you execute the code that checks the date and sends the emails

9 minutes ago, bernhard said:
  • subscription management (what happens if ... and what if ... and so on ...)
  • mail deliverability (not too hard but you need to be careful)
  • mail layouts (responsive, different mail clients etc)

Subscription would be a "nice to have" feature. My performance concern above was about delivering/sending the emails from the shared hosting server. I dont't think I could use external services like MailChimp to send these mails, because they will have dynamic content in them (event name, even date, etc.). So WireMail seems like the way to go here. For the mail layout I will use css tables and inline styles, but the layout will not be that complicated  ?

Link to comment
Share on other sites

I forgot to ask: How many mails will be sent? Tens? Hundreds? Thousands?

4 minutes ago, jploch said:

Maybe I am thinking about it the wrong way, but how would the script be triggerd if not with a cronjob or something? How/when would you execute the code that checks the date and sends the emails

Sure a cronjob would be the way to go. LazyCron can be an alternative on a shared host, but might not be the best solution ? 

  • Like 1
Link to comment
Share on other sites

1 minute ago, bernhard said:

I forgot to ask: How many mails will be sent? Tens? Hundreds? Thousands?

Most likely less than 100 per day. There will propably have to be a verification of some kind to prevent spam? Maybe limit the amount of posted emails per session?

Link to comment
Share on other sites

There is a lot going on here. You mentioned that visitors (guests or logged-in users?) will be able to subscribe to multiple events at once, but you will likely only want to verify the email once. AFAIK the only way to verify emails is to actually send a secret to the address and have the recipient send it back. So I would do a poor man’s solution somewhat like this:

  1. Create one page per recipient that stores the address and a secret token (ProcessWire can generate one for you like this: (new Password())->randomBase64String())
  2. When the user has entered their address and you have created the page, send them a link like https://example.com/verify?mail=myemail@example.com&mytoken=xyIu6yehxXfTelYpqcOdv8
  3. When that link requested, find the recipient and consider them verified if the token matches (i.e. set a checkbox or just delete the token and consider everyone without one verified)
  4. Store event subscriptions as multiple page references either on the recipient or on the event, whatever

As long as these transactional mails don’t go overboard you should be fine. If you don’t need any personalisation, you might actually send the event reminders as a single email per event, just dumping everyone into BCC.

If you’re thinking of growing the business, you will want to go with a dedicated solution such as https://de.sendinblue.com/preise/ (a German company formerly known as Newsletter2Go, should be fine GDPR-wise). Mass mailing is serious business. You don’t want to get blocked by Gmail or something, so above some threshold it’ll be worth shelling out for a service whose business is making sure emails go through.

You mentioned you’re on shared hosting. Do you have cron jobs at all? Some shared hosting providers offer something like “cron jobs lite”, where you get a configuration form and the only action you can perform is an HTTP request. In that case you just expose some URL from your site that will send emails upon request.

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...