It was already setup so I can't shed any light on that process. Because we store the names in a database I was able to check if the email was there, and if not allow them to send the subscribe/unsubscribe email. Here is the addition to profile.php
PHP Code:
// ## SK: Start Extra Profile Page - by Sarah King ##
if ($_REQUEST['do'] == 'editmaillist')
{
// makes the user cp nav look correct
construct_usercp_nav('editmaillist');
// sets the area discription, feel free to change
$navbits[''] = "Manage Automatic Emails";
// sets template name to be called when the action is preformed
$templatename = 'MAILLIST';
// sets shell template
$shelltemplatename = 'USERCP_SHELL';
$emailaddressq = mysql_escape_string($bbuserinfo['email']);
$mlsql = "SELECT `address` FROM ezmlm.tablelist WHERE `address`='$emailaddressq' limit 0,1";
$result = mysql_query($mlsql) or die(mysql_error().'<br>'. $mlsql);
$subscribed = ($result && mysql_fetch_row($result));
if ($subscribed) {
$emailliststatus ='Subscribed';
$emailnewstatus = 'unsubscribe';
$emaillistnexturl = 'removemaillist';
}
else
{
$emailliststatus ='Unsubscribed';
$emailnewstatus = 'subscribe';
$emaillistnexturl = 'addmaillist';
}
}
// this is so that when a user saves their info it does get saved
if ($_REQUEST['do'] == 'addmaillist')
{
mail('listname-subscribe@mysite.com', '', '',
"From: {$bbuserinfo['email']}\nReturn-path: {$bbuserinfo['email']}");
// makes the user cp nav look correct
construct_usercp_nav('addmaillist');
// sets the area discription, feel free to change
$navbits[''] = "Manage Automatic Emails";
// sets template name to be called when the action is preformed
$templatename = 'MAILLISTCHANGE';
// sets shell template
$shelltemplatename = 'USERCP_SHELL';
$emailnewstatus = 'subscribe to';
$emailextra = "<b>A confirmation message has now been sent to {$bbuserinfo['email']}.</b><br><br>
To confirm your subscription, simply reply to that email.<p>"
}//if ($_REQUEST['do'] == 'addmaillist')
if ($_REQUEST['do'] == 'removemaillist')
{
mail('listname-unsubscribe@mysite.com', '', '',
"From: {$bbuserinfo['email']}\nReturn-path: {$bbuserinfo['email']}");
// makes the user cp nav look correct
construct_usercp_nav('removemaillist');
// sets the area discription, feel free to change
$navbits[''] = "Manage Automatic Emails";
// sets template name to be called when the action is preformed
$templatename = 'MAILLISTCHANGE';
// sets shell template
$shelltemplatename = 'USERCP_SHELL';
$emailnewstatus = 'unsubscribe from';
}//if ($_REQUEST['do'] == 'removemaillist')
// ## SK: End Extra Profile Page - by Sarah King ##
// ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##