"Send to Both" option causes errors on user registration and failing email
iva2k - June 14, 2009 - 05:22
| Project: | User registration notification |
| Version: | 6.x-1.10 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | Roadmap |
Description
Notification emails are not sent when "Both" is selected and "Send notifications to this custom email address:" is filled with some role(s) selected. The user who tries to register gets error message and knows nothing what it means and how he should address it. Some users tries to re-register, some leave the site for good.
Current work-around - do not use "Send to both" option.

#1
Attached is a patch that:
1. addresses that issue of "Send to both" giving error message to register user.
2. Removes duplicate email addresses from send to list, if any
3. Removes empty log message that carries no meaning
#2
I need to do some testing. I don't see anything wrong with the patch but it will only catch duplicate addresses if you only enter 1 custom address. It will catch dupes but if you enter several emails all separated by comma's it wont work.
#3
#4
#5
Oh, I see, you're right - it won't catch duplicates if there are multiple addresses in the "Send notifications to this custom email address:" field. I know how to fix that though. New patch attached. The trick is using preg_split():
$emails = preg_split('/,[\w]+/', variable_get('user_register_notify_mailto', $from));#6
#7
Committed to CVS. Will be in the 6.x-1.11.
Thanks
Robert
#8
#9
Automatically closed -- issue fixed for 2 weeks with no activity.