Permalink
Browse files

Not send email confirmation (#205)

* Not send email confirmation$

* little code correction$

* correct comment, and move setting to config.php

* move back to config_extend and change default value
  • Loading branch information...
jd440 authored and michield committed Nov 23, 2017
1 parent b5bbd36 commit bb0bf5a757d655c60789c0c791a49ffaf3576469
Showing with 20 additions and 8 deletions.
  1. +3 −1 public_html/lists/admin/init.php
  2. +4 −0 public_html/lists/config/config_extended.php
  3. +13 −7 public_html/lists/index.php
@@ -258,7 +258,9 @@
if (!defined('SHOW_SUBSCRIBELINK')) {
define('SHOW_SUBSCRIBELINK', true);
}
if (!defined('UNSUBSCRIBE_CONFIRMATION')) {
define('UNSUBSCRIBE_CONFIRMATION', true);
}
if (ASKFORPASSWORD && defined('ENCRYPTPASSWORD') && ENCRYPTPASSWORD) {
//#https://mantis.phplist.com/view.php?id=16787
// passwords are encrypted, so we need to stick to md5 to keep working
@@ -177,6 +177,10 @@
// the default way, which will ask them for a reason, set this to 1
define('UNSUBSCRIBE_JUMPOFF', 0);
// To not send confirmation of unsubscription , instead of
// the default way, which will send it, set this to false
define('UNSUBSCRIBE_CONFIRMATION', true);
// when a user unsubscribes they are sent one final email informing them of
// their unsubscription. In order for that email to actually go out, a gracetime
// needs to be set otherwise it will never go out. The default of 5 minutes should
@@ -887,19 +887,25 @@ function unsubscribePage($id)
addUserToBlacklist($email, nl2br(strip_tags($_POST['unsubscribereason'])));
addUserHistory($email, 'Unsubscription', "Unsubscribed from $lists");
$unsubscribemessage = str_replace('[LISTS]', $lists, getUserConfig("unsubscribemessage:$id", $userid));
sendMail($email, getUserConfig("unsubscribesubject:$id"), stripslashes($unsubscribemessage),
system_messageheaders($email), '', true);
if (UNSUBSCRIBE_CONFIRMATION) {
sendMail($email, getUserConfig("unsubscribesubject:$id"), stripslashes($unsubscribemessage),
system_messageheaders($email), '', true);
}
$reason = $_POST['unsubscribereason'] ? "Reason given:\n".stripslashes($_POST['unsubscribereason']) : 'No Reason given';
sendAdminCopy('List unsubscription', $email." has unsubscribed\n$reason", $subscriptions);
addSubscriberStatistics('unsubscription', 1);
}
}
if ($userid) {
$res .= '<h3>'.$GLOBALS['strUnsubscribeDone'].'</h3>';
}
//0013076: Blacklisting posibility for unknown users
if ($userid) {
if (UNSUBSCRIBE_CONFIRMATION) {
$res .= '<h3>' . $GLOBALS['strUnsubscribeDone'] . '</h3>';
} else {
$res .= '<h3>' . $GLOBALS['strUnsubscribedNoConfirm'] . '</h3>';
}
}
//0013076: Blacklisting posibility for unknown users
//if ($blacklistRequest) {
//$res .= '<h3>'.$GLOBALS["strYouAreBlacklisted"] ."</h3>";
//}

0 comments on commit bb0bf5a

Please sign in to comment.