"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

iva2k - June 14, 2009 - 05:24
Status:active» needs review

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

AttachmentSize
urn_both.patch 2.28 KB

#2

rmiddle - June 15, 2009 - 16:34

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

rmiddle - June 15, 2009 - 16:35

#4

rmiddle - June 15, 2009 - 16:35
Status:needs review» reviewed & tested by the community

#5

iva2k - June 16, 2009 - 06:32

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));

AttachmentSize
urn_both.2.patch 2.32 KB

#6

iva2k - June 16, 2009 - 06:33
Status:reviewed & tested by the community» needs review

#7

rmiddle - July 2, 2009 - 03:42

Committed to CVS. Will be in the 6.x-1.11.

Thanks
Robert

#8

rmiddle - July 2, 2009 - 03:42
Status:needs review» fixed

#9

System Message - July 16, 2009 - 03:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.