0

I'd like to send private messages (with email notification) to groups of users. These groups can be either pre-defined or ad-hoc selected. Is there any way to implement this feature in a Drupal site?

I found Privatemsg which seemed quite promising since it has Views- and Rules-integration. But after all it has not meet the requirements: I couldn't find a way to populate the recipients field with multiple users (I thought using a view with exposed filters and VBO would be a handy tool for selecting users).

Is there any solution for this?

0

Using the Forena module, you could start from one of the Sample reports and solutions that come with it. I.e. the Active Users Email, which is a demo of the ability to send email to all active users of a Drupal site.

The idea is that those users who have access to it, actually get a FORM to have Drupal send an eMail to all users selected via the query. To do so, you just have to "submit the report".

The easiest way to see the out-of-the-box example at work, is to (temporary) install the module in some dev environment you have available (for obvious reasons this sample report is NOT available to anonymous users in a Forena demo site ...).

Here is what would be needed to transform (clone) this sample to fit your needs:

  • Adapt its data block (an SQL query) to list "all persons to be eMailed" (instead of all "active users of a Drupal site").
  • Adapt the actual content of the delivered eMail template to fit the actual eMail content (message).
  • Optionally you may want to make the "group" to be selected a report parameter.
  • Secure "access" so that only authorized users can send such eMails. Depending on how your security is setup, you may want to adapt the Forena permissions accordingly.

The above approach can be used for all sorts of eMails towards any set of users of a Drupal site. Whereas that "set of users" is just a matter of writing some (basic) SQL statement to select the users you want to target. E.g:

  1. Users with a selected role or
  2. Users who didn't login for X days anymore or
  3. Groups of users that are either pre-defined or ad-hoc selected (as in your question), whereas you'd need 'something' to actually indicate that ad-hoc selection that you can retrieve via some SQL query, like:
    • a taxonomy term.
    • some flag (using the Flag module).
    • all members of a group, created using either Group or Organic Groups .
    • etc.
  4. ...

And the actual eMail content (message to be delivered) is actually anything you can format as an XHTML document.

Disclosure: I'm a co-maintainer of the Forena module.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.