I noticed that Privatemsg hasn't send the Notify Mail for new PM to Users when using User-Roles instead of Usernames as Recipients.

I am using PHPMailer 7.x-3.x-dev with SSL (Port 465).
I checked if there is anything wrong with my PHPMailer Config.
I got a testmail by PHPMailer that my site is properly configured to use PHPMailer sending Emails.

So in step 2 I checked the settings of my Privatemsg module. I sended a test-PM to myself.
The submit results in a successfull Message. 5 Minutes later I got a Mail Notification to my Inbox with
"You habe a new Private Message ....."
OK fine!

I sended a second PM to 5 other user accounts with the same result. All 5 Users belong to the role "Testusers".

The 3rd and last try was to send a PM to the role "Testusers" ... and I got a successfull submit for sending the PM with the effect that everybody's PM-Inbox had a new message.
But in all 5 cases no Mail has been send to inform the users about a new entry in their Message-Box.
In every user profile is saved a valid email adress.

The Log files are empty! No errors.

I haven't configured Limits to Privatemsg nor are user rights missing sending PMs to roles.

I am sure that sending PMs to roles has been worked till 7.x-1.2 with same settings.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

-Mania-’s picture

I can confirm this. When sending to all users of a role there is no email notification. :(

chrisssi’s picture

Hi @ all,

is there anybody outside (one of the Privatemsg Project) who can confirm this issue too?

There weren't updates since August 2012 but maybe there are workarounds to solve the problem?

Regards

twuli’s picture

Hello, yes, I have also the problem.

PM generates a Role keien e-mail notification.

Too bad that there was no response so far.
Had already written a message: http://drupal.org/node/1658012

Greetings
Twuli

ptmkenny’s picture

Marked http://drupal.org/node/1862118 as a duplicate

ptmkenny’s picture

Marked http://drupal.org/node/1658012 as a duplicate

chrisssi’s picture

Update July 21, 2013

I've updated to the latest stable 7.x-1.4
https://drupal.org/node/2044601

Never the less I can't receive Notify-Mails by sending new PMs to a role (whole member group of Users)

There are no failures / errors shown in the log files. The PMs are delivered! All members of a group receive the PM - but this isn't practicable without having the notify by mail when users are logged of the drupal website.

Is there anybody outside who have an idea about the problem?

Thanks a lot.

ptmkenny’s picture

Yes, this is a confirmed bug but there is no solution yet. Patches are welcome if someone has already fixed this.

akshat.khariwal’s picture

Have created a patch to be used in 'pm_email_notify.module'. This will send email notifications to each and every user of that role(s).

akshat.khariwal’s picture

Status: Active » Needs review
FileSize
5.23 KB

Resubmitting the patch. please ignore above.

Status: Needs review » Needs work

The last submitted patch, email-notify-for-pm-to-roles-1726758-1.patch, failed testing.

ptmkenny’s picture

Patch header is wrong so it won't apply, re-rolled.

ptmkenny’s picture

Status: Needs work » Needs review
ptmkenny’s picture

Version: 7.x-1.3 » 7.x-1.x-dev

Status: Needs review » Needs work

The last submitted patch, email-notify-for-pm-to-roles-1726758-1-11.patch, failed testing.

ptmkenny’s picture

Status: Needs work » Needs review
FileSize
5.08 KB

Re-rolled patch in git

brainHax’s picture

Status: Needs review » Closed (fixed)

yes it seems that it does work . i sent a msg to a role , and my inbox is full of email delivery messages . (coz my all users profiles were dummy)

ptmkenny’s picture

Status: Closed (fixed) » Reviewed & tested by the community

@brainHax If a patch works, please mark it "reviewed and tested by the community." A patch should not be closed as fixed until it has been committed.

twuli’s picture

hello,

I tested the patch today.
The notification by e-mail to all users of the work role.
Thank you so much.

A small error still exists in the line of the parties to a message.
The owner of the message gets displayed: conversation between you and + Member (Role) (was only so long as no one answered)
a party member gets displayed: conversation between you and Mario
-> Can be changed so that the involved + member detects that it is a PM to a user group with the role "+ member"?

regards
twuli

twuli’s picture

Issue summary: View changes

Update

ShaunDychko’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
+++ b/pm_email_notify/pm_email_notify.module
@@ -34,25 +34,63 @@ function pm_email_notify_privatemsg_message_insert($message) {
+  $query = 'SELECT DISTINCT(ur.uid)
+        FROM {users_roles} AS ur
+        WHERE ur.rid IN (:rids)';

This query will retrieve blocked users, which might not be what is intended.

ShaunDychko’s picture

Status: Needs work » Reviewed & tested by the community

Ah, critique in #19 doesn't matter since the module tests for whether the user is block before sending them a message in privatemsg_privatemsg_block_message(). Setting back to RTBC (although I haven't actually applied the patch myself. I went with a VBO and Rules approach to mass private messages).

ivnish’s picture

Status: Reviewed & tested by the community » Closed (outdated)