No alerts work, when I select to send to a specific role, such as administrator.
Fix,
change, ':role' to :role,
i.e. change
$result = db_query("SELECT mail FROM {users} AS u INNER JOIN {users_roles} AS r ON u.uid = r.uid WHERE r.rid IN(':role') and u.status = '1' ", array(':role' => $roles));
to
$result = db_query("SELECT mail FROM {users} AS u INNER JOIN {users_roles} AS r ON u.uid = r.uid WHERE r.rid IN(:role) and u.status = '1' ", array(':role' => $roles));
Note, it can help to add:
watchdog('user_register_notify', 'email to=' . check_plain($to));
after:
$to = implode(', ', $emails);
to actually see in the logs who emails are sent to.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Issue-1304262-by-hackwater-hass-fix-incorrect-parsin.patch | 2.79 KB | hass |
| #2 | user_register_notify-role-parsing-1304262.patch | 875 bytes | hackwater |
Comments
Comment #1
steingard commentedNice. This works, thanks.
Dear maintainer, please commit.
Comment #2
hackwater commentedSeconded; also, I am including a patch file of boran's change.
Comment #2.0
hackwater commentedadd debug tip
Comment #3
autopoietic commentedI can confirm patch in #2 works. Looks like this module may no longer be maintained?
Comment #4
knalstaaf commentedRTBC
Comment #5
hass commentedFixed the code style issues.
Comment #7
hass commented