notifications vs alerts

10 views
Skip to first unread message

laurent...@gmail.com

unread,
Oct 21, 2024, 8:19:48 AM10/21/24
to Alaveteli Dev
Hello,

While modifying some of our email templates, I noticed that many of them appear duplicated.
For instance, there are:
- app/views/notification_mailer/overdue_notification.text.erb
- app/views/request_mailer/overdue_alert.text.erb
which are exactly the same.

Likewise:
- app/views/request_mailer/new_response.text.erb
- app/views/notification_mailer/response_notification.text.erb
are almost the same, save for a different line in case of embargoed requests.

Other templates appear duplicated in a similar way.
Is there a particular reason why this is the case? And is the intention to keep them separate, or you'd rather like to merge them but it's a low priority thing?

My question is mostly to figure out if I've missed something essential while overriding the ones listed above.
Thanks!

Graeme Porteous

unread,
Oct 21, 2024, 12:36:45 PM10/21/24
to alavet...@googlegroups.com
Hi Laurent,

A bit of background: Alerts are for non-Pro users where all their
requests are made individually as alert emails are all sent and the
events are created. Where as Notifications is a feature enabled when
users sign up to Pro, this causes alerts to be batched up into a
single daily summary.

Notifications are important for example when using batch requests. As
these requests are all sent at the same it as this would cause an
influx of mail to the users EG. around the time when overdue alerts.

I would imagine we would like to simplify the approach maybe moving
all users to notifications in the future but this is certainly low
priority. For now merging views would be a good idea. The simplest way
to do this would be by adding a <%= render partial: ... %> call in the
*_alert.text.erb files to render to the notifications version.

Aside: I've just made a quick PR
https://github.com/mysociety/alaveteli/pull/8429 to add notification
mailer previews. When running Alaveteli development mode these can
viewed from http://127.0.0.1:3000/rails/mailers/

Cheers,

--
Graeme Porteous
gra...@mysociety.org
> --
> You received this message because you are subscribed to the Google Groups "Alaveteli Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to alaveteli-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/alaveteli-dev/83f21e88-58d0-482f-ba2f-1f65fd89e318n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages