Simplenews Modification

Hey there,

I took a stab at modifying this for use with Simplenews. Seems like the only required change is in the _newsletter_checkbox_form_submit function. Make the second argument of simplenews_subscribe_user the term ID of the newsletter you want the checkbox to apply to; for me it happened to be 2.


function _newsletter_checkbox_form_submit($form_id, $form_values) {
if ($form_values['subscribe_newsletter']) {
$email = $form_values['mail'];
simplenews_subscribe_user($email, 2, FALSE);
}
}

Thanks for laying the groundwork!

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <h4>
  • Lines and paragraphs break automatically.

More information about formatting options