ive got a php routine to send a notification to everyone in an EE mailing list whenever a new entry is posted to my blog.
works fine, BUT i would like to include unsubscription info at the bottom of these notifications.
problem is, since the emails are being generated from a php extension, i dont have access to the mailing list tag {unsubscribe_url}
how do i work around this? i imagine there’s a routine i can access?
Moved by Moderator to Extensions: Technical Assistance
I may shift this to ‘extensions’ as it’s a third party script- and I don’t know how it works. Sending mail via the standard communicate approach, you’d just tweak the templates and use the unsubscribe_url variable- as you note. But no telling how the extension handles it.
Which extension is it?
thanks for the reply, robin.
the extension i’ve modified is called Snitch. originally written (not by me) to extend the Notification system, I’ve added code that will further extend it by adding a specified mailing list to the recipients.
here’s the snippets of code in question:
if ( ! class_exists('EEmail'))
{
require PATH_CORE.'core.email'.EXT;
}
$email = new EEmail;
and then later:
$query = $DB->query("SELECT email FROM exp_mailing_list WHERE list_id = '".$list_id."' ORDER BY email asc");
if ($query->num_rows > 0)
{
foreach($query->result as $row)
{
$addy = $row['email'];
$email->initialize();
$email->wordwrap = false;
$email->from($PREFS->ini('webmaster_email'), $PREFS->ini('webmaster_name'));
$email->to($addy);
$email->reply_to($PREFS->ini('webmaster_email'));
$email->subject($email_tit);
$email->message($REGX->entities_to_ascii($email_msg));
$email->Send();
}
}
how best to change this to use Communicate module as you suggest?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.