Gizmo -

OK a few more things to tweak smile.

You have your code in the first part of the loop - the "which" part. However, I'm not manually selecting my users. I'm sending out to thousands of them - everyone within my selection group. So your code which was on line 53 to add to the body wasn't activating.

I'm down in the else starting with line 81, which triggers if one is mailing to the whole group being selected. I.e. all non-banned members in my case.

So my code has to be down in line 217 and look like this:

// --------------------------------------
// Are we sending via BCC or one a a time
if ($onebyone) {
if ( (strcmp($Email,"") != 0) && preg_match("/@/",$Email) ) {

$mailbodycust = $mailbody . "\n\n<br><br>\n" . $ubbt_lang['UNSUBSCRIBE'] . ":<br>\n" . "<a href=\"" . $config['FULL_URL'] . "?ubb=unsubscribe&email=" . $Email . "\">" . $config['FULL_URL'] . "?ubb=unsubscribe&email=" . $Email . "</a>";

$sentto .= " $Email,";
$mailer->set_language($config['LANGUAGE']);
$mailer->set_subject('DSE_SUBJECT', array('SUBJECT' => $subject));
$mailer->set_salute('EMAIL_SALUTE',array('USERNAME' => $Display));
$mailer->add_content('DSE_CONTENT', array('CONTENT' => $mailbodycust));
$mailer->ubbt_mail($Email);


Then it fills in properly in the message.

However, the URL isn't right smile The URL this creates is:

http://www.romanceclass.com/forum?ubb=unsubscribe&email=income@lisashea.com

but that's not valid. It needs to be:

http://www.romanceclass.com/forum/ubbthreads.php?ubb=unsubscribe&email=income@lisashea.com

So the code therefore is:

$mailbodycust = $mailbody . "\n\n<br><br>\n" . $ubbt_lang['UNSUBSCRIBE'] . ":<br>\n" . "<a href=\"" . $config['FULL_URL'] . "/ubbthreads.php?ubb=unsubscribe&email=" . $Email . "\">" . $config['FULL_URL'] . "/ubbthreads.php?ubb=unsubscribe&email=" . $Email . "</a>";

Once I put that in, it does correctly generate user-specific code that works properly. When the user first goes there it gives them an unsubscribe button. When they click it and go to the link again, it lets them know that they are already unsubscribed.

When I go to that user via their profile, it does say:

From time to time we send out emails regarding this community.
Do you wish to receive these emails?

NO.

So that is all now tied together and set.

Last edited by BellaOnline; 01/02/2013 7:19 AM.

Lisa Shea, owner, BellaOnline.com
BellaOnline Website
BellaOnline Forums - UBB since Apr 2002 - 58,000 members / 850,000 posts