Add list-unsubscribe

This commit is contained in:
2020-04-06 20:59:53 +02:00
parent 8f10febcf2
commit c01fe7f3bd
5 changed files with 10 additions and 6 deletions

View File

@@ -126,8 +126,8 @@ class Email extends PhpObject {
$oPHPMailer->Password = Settings::MAIL_PASS; //SMTP password
$oPHPMailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
$oPHPMailer->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
$oPHPMailer->setFrom(Settings::MAIL_USER, 'Spotty');
$oPHPMailer->addReplyTo(Settings::MAIL_USER, 'Spotty');
$oPHPMailer->setFrom(Settings::MAIL_FROM, 'Spotty');
$oPHPMailer->addReplyTo(Settings::MAIL_FROM, 'Spotty');
foreach($this->asDests as $asDest) {
try {
@@ -138,6 +138,8 @@ class Email extends PhpObject {
//Unsubscribe Link
$sUnsubLink = $this->sServName.'?a=unsubscribe_email&id='.$asDest['id_user'];
$oEmail->setTag('unsubscribe_link', $sUnsubLink);
$oPHPMailer->addCustomHeader('List-Unsubscribe','<mailto:'.Settings::MAIL_FROM.'?subject=unsubscribe>, <'.$sUnsubLink.'>');
$oPHPMailer->addCustomHeader('List-Unsubscribe-Post','List-Unsubscribe=One-Click');
//Email Content
$sHtmlMessage = $oEmail->getMask();

View File

@@ -11,6 +11,7 @@ class Settings
const TEXT_ENC = 'UTF-8';
const TIMEZONE = 'Europe/Paris';
const MAIL_SERVER = '';
const MAIL_FROM = '';
const MAIL_USER = '';
const MAIL_PASS = '';
const DEBUG = true;

View File

@@ -478,9 +478,10 @@ $legend-color: $post-color;
.settings-section {
display: inline-block;
width: 100%;
margin-top: 1.5rem;
h1 {
margin: 1.5rem 0 1rem;
margin: 0 0 1rem;
}
label {
@@ -490,7 +491,7 @@ $legend-color: $post-color;
}
&.title {
margin: -1rem;
margin: -1rem -1rem 0 -1rem;
width: calc(100% + 2rem);
background: rgba(255, 255, 255, 0.4);
text-align: center;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long