Qondio
Front
Intel
IntelMart
Shares
My Qondio
Account
Custom Website - Real Tidings > Intel > Add Newsletter Signup to Drupal Registration

qondio.com/8hww PRINT EMAIL

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

Contributed by Custom Website - Real Tidings on January 15, 2008, at 1:52 PM UTC.

Reactions

No reactions yet.

Rate This Intel

Please login or sign up to rate this intel.

Comments

Please login or sign up to add a comment.

Share

Copyright Notice

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.

Login Here with
Any Email Address
Any Password
No account? Sign up.

Intel Contributor
This intel was contributed by Custom Website - Real Tidings


Custom Website - Real Tidings

Qondio Archive
May, 2012
123456
78910111213
14151617181920
21222324252627
28293031


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

Sign Up
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.

About Qondio
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.

ABOUT
SUCCESS GUIDE
FEATURES
FAQ
ADVERTISE
CONTACT
USAGE POLICY
PRIVACY POLICY


TWITTER
FACEBOOK