|
   |
|
|
Add Newsletter Signup to Drupal Registration
This is a very simple hack to allow users to sign up to your newsletter when they register on your Drupal site. Please note that this only works if your autoresponder has a direct email for each list. That is, you can send an email and the system adds the user in the "From" field. 1) Go to admin/user/profile 2) Add at least two custom profile fields: - text field for Full Name (form name profile_FullNameField) - checkbox for Subscribe (form name profile_CheckBoxName) 3) Edit the user.module file and place the custom code on line 241: // Build the finished user object. $user = user_load(array('uid' => $array['uid'])); } /*** CUSTOM CODE START ***/ // Check and subscribe to newsletter if applied if ($user->profile_CheckBoxName == 1) { $regEmail = $user->mail; $regName = $user->profile_FullNameField; $to = 'email@direct-response-auto-responder.com'; $subject = 'subscribe'; $message = 'subscribe'; $headers = 'From: '.$regName.'<'.$regEmail.'>'."\r\n".'Reply-To: '.$regEmail."\r\n".'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); } /*** CUSTOM CODE END ***/ // Save distributed authentication mappings Of course, you will want to edit the code in insert your autoresponder email address. Also note that I would copy the UNEDITED user.module file and save it as user.module.bak just in case something goes wrong. Once its complete you are good to go. Now, when users check the box to add your newsletter, the system will send the request automatically! Cool :) |
|
 |
|
No reactions yet.
Please login or sign up to rate this intel.
Please login or sign up to add a comment.
The copyright for this content entitled "Add Newsletter Signup to Drupal Registration" has been specified by the contributor as:
All Rights Reserved
This content may not be copied, distributed or adapted by anyone under any circumstances.
|
 |
May, 2012
2008
January, February, March, April, May, June, July, August, September, October, November, December
2009
January, February, March, April, May, June, July, August, September, October, November, December
2010
January, February, March, April, May, June, July, August, September, October, November, December
2011
January, February, March, April, May, June, July, August, September, October, November, December
2012
January, February, March, April, May
|
|
Not a member yet?
Qondio is a powerful network for making it online. If you have a website to
promote, we can help.
Sign up and get in on the action.
|
|
Welcome to Qondio! Discover the awesome power this network can deliver by going to our About page. Or you could skip straight to the Sign Up form.
|
|