[SOLVED] Not overloading users with email

Imagine one has content rules (or similar) which sends users email too often:

Is it possible from Plone to for example

  1. 'ask' the mailhost to send them at a certain time of day (so the users gets 5 mail in the morning instead of 1 every few hours

UPDATE 2:

UPDATE: This is how it works now:

or

  1. Somehow 'notify User' when he/she logs in and showing the info which now is sent in email ?

I assume #2 would be quite difficult, but it would be very nice if the 'Notify User' had an option for 'which user' and more or less the same options that are available for 'mail'. Even better if it (they) showed on the dashboard.

An option could be to send the email to a mailing list with a daily digest instead of immediate delivery. Another option is:

to create a minimal content in a folder and list it at login.

Contentrules has a notify action but it is immediate.

1 Like

We would be interested in a plugin that batches notifications from content rules, esp on a schedule the user can control.
Are others using a third party service for this now instead of a plugin?

I am 'giving this a try'.

For selecting 'which users to notify', I assume I could use vocabulary ' plone.app.vocabularies.Principals

But: What would be a good way to check if 'current user is selected'?
Should I make an indexer that stores 'each user' or is there any other way to do this?

What is the context of your question? Who is selecting which user? If you want to notify a user when they log in, you would want to hook into the login events, then you would use the current user.

To not overload the users with email, I have made a content type (Notifications) that 'looks like normal Notifications.
Then I add a content rule and notifications are added 'when something happens'. (instead of (for example) sending a mail 'something happened on the site', this info is now presented 'when user logs in again'.

My approach (now) is to store an index of users and get all 'Notifications' that are 'to user xxx' . In other words: if the field contains groups, I index them as 'users'.
Will try to publish something tomorrow to explain better.

If it should be of interest, I am trying to make something here ( Classic Plone for now), any feedback is welcome:

By user: do you mean 'a setting for each user', or the 'user that adds the notifications' ?

I was thinking a setting for each user but you could also have some sender control.

I was thinking along the idea of "immediately", "once per hour", "once per day", "once per week", "mentions only" etc. But building in the ability for certain events or senders to override this to send immediatly makes sense.
Probably a good idea to find a specific app that exists now works in a way that people like?
For example github doesn't have this batching feature.

another way to go is to let the user ignore certain "types" of notifications and based on where in the site the notifications are coming from. Youd have to have some central vocab of notification type.

Some of the notifications we had in mind are reminders to rereview content and comment notifications.

I probably wouldn't use a content type. it's pretty heavy weight. Something like souper would probably work better. Also by separating out where the notifications are stored you have the potential to mount this in a seperate ZODB to manage your memory better.

It's interesting to note that not even discourse has batching.

They have ignoring for certain kinds of events

Scheduled times which isn't batching since it would still send each notification individually

The only kind of batching it has is summary which is a different thing as it's not collecting notifications but running some report on interesting content and won't include everything.

w

One problem with batching is that you then have to send each notification inside some new template and it makes it harder if you have some action for each one.

It seems like the more popular way to go is options to ignore certain kinds of email alerts for notifications (like the "first like of the day" above) but then you'd have a way to see all the notifications once you log in?

Either way you're still creating a DB of notifcations and having some user action to give preferences how emails are sent based on those.

Content rule -> create notification (set notification type) -> DB -> email rule (using user prefs) -> send email

My current solution is to 'set time of day' (or a hard-coded (DateTime) and the notification is visible from that time.

In other words: If you set 00:00 the notification will show from midnight, so when the user logs in 'next day or later' he/she will see it.

If the time is set to 12:00, the users will see it at lunch the same day if the notefication was created early in the morning, but 'at lunch 12:00' the next day if the norification was created 'after lunch'.

For the email (if we need that), my plan was/is to have a view that can be called from a cron script for example each night at 00:00 and send an email to each user about 'what happened last day'.

About using 'ContentType': for my use case this will not be a problem, I think (we dont have very many users and the Notifications can be deleted for example when everyone has read them, so I dont think they will fill up the database. Also, I am thinking about adding collective.collectionfilter to the display of the notes, so that makes it easier (especially since I havent used souper for 5 years :), at least )

Yes, that is how it works now. But I also added an option (for the creator or the content rule to postpone the notification to (from) a certain time of day (as shown in the videos posted in the 'updated part of the question)

If it should be of interest, my add-on / code is (as mentioned) here: GitHub - espenmn/medialog.notifications: A notification add on for Plone

I could set up a demo (site) if it is of interest.

PS: I dont 'really' have a budget for this, so I have tried to not overcomplicate, but I can/will try to add 'useful things' if the community has interest in it.

If you are thinking about 'sending an email' (which I have not added yet): This could be done with a cron script that calls a view (or endpoint). Is that a 'sane way' of doing this', or will it be slowing the site (too much).

About 'mentions etc': a typical approach (for me) is if 'your are an attendant of a meeting' or if an item has been 'delegated to you'. For this, I use for example ${attendees} (which would be 'invited to a meeting' ) or ${assigned} / ${reviewer}

I (just) made a browser view (plan: call it from a cron script).
Do you have any suggestions on how to 'have the settings' for 'when to be notified' (should I add that to userschema properties, or does this belong 'somewhere else' ?