Hi all, my organization recently moved our website to the Drupal platform and I just have to say: Drupal ROCKS! I just put together our first e-newsletter using the simplenews module, but I have a problem. I would like to use my own unsubscribe link so that I can capture email addresses (via a webform) and cross check them with an external member database.

Is there any way to: 1. prevent the automatic unsubscribe footer from appearing 2. replace the auto unsubscribe link with a different link 3. capture the email addresses that are removed via the automatic simplenews unsubscribe feature.

I understand that there may be a way to achieve this end by using the simplenews template module, but that is a little beyond my technical capacity (I'm a total novice). Any advice would be greatly appreciated. Thanks so much.

Paul

Comments

sutharsan’s picture

You can achieve 1 and 2 with theming the newsletter footer. This solution requires some editing, ftp and html skills and works for *all* simplenews newsletters on the site.

Create a template.php file in the directory of your sites theme (example /themes/garland). If the file already exist open the file for editing.

make a backup copy of any existing template.php file, just in case.
Add / append the following code to the (new) file:

function my_theme_name_simplenews_newsletter_footer($node, $hash) {
  if ($node->s_format == 'html') {
    $node->body .= '<p>-- <br />'. l(t('Click here to unsubscribe from this newsletter'), 'newsletter/confirm/remove/'. $hash, array(), NULL, NULL, TRUE) .'</p>';
  }
  else {
    $node->body .= "\n\n-- \n". t('Unsubscribe from this newsletter: @url', array('@url' => url('newsletter/confirm/remove/'. $hash, NULL, NULL, TRUE)));
  }
  return $node;
}

Replace each $node->body .= ... ; line with one of the examples below.

    $node->body .= '';  //this removes the unsubscribe link completely
    $node->body .= 'This links to <a href="http://mysite">my site</a>'; //a custom plain text link to my site

I hope this is not beyond your 'novice' skills.

-- Sutha

-- Erik

seren10pity’s picture

On Drupal 6, simply copy "simplenews-newsletter-footer.tpl.php" (from Simplenews module folder) on your template folder.
Copy the code corresponding to the unsubscribe link to paste it (and modify) at the place you want, and then erase the code in the template file to do not let it appearing in your mail anyway.

Hope its clear, and it helps ;)

mooru’s picture

Any tips on how will be done in drupal7