From 9318114e197b61f2092ccc9ec8a8b9936744baad Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 10 Jan 2024 16:13:20 -0800 Subject: [PATCH] CiviMail - Add status-check for civimail_unsubscribe_methods --- CRM/Utils/Check/Component/Mailing.php | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CRM/Utils/Check/Component/Mailing.php diff --git a/CRM/Utils/Check/Component/Mailing.php b/CRM/Utils/Check/Component/Mailing.php new file mode 100644 index 0000000000..b7288fb8f0 --- /dev/null +++ b/CRM/Utils/Check/Component/Mailing.php @@ -0,0 +1,46 @@ +get('civimail_unsubscribe_methods'); + if (in_array('oneclick', $methods)) { + return []; + } + + // OK, all guards passed. Show message. + $message = new CRM_Utils_Check_Message( + __FUNCTION__, + '

' . ts('Beginning in 2024, some web-mail services (Google and Yahoo) will require that large mailing-lists support another unsubscribe method: "HTTP One-Click" (RFC 8058). Please review the documentation and update the settings.') . '

', + ts('CiviMail: Enable One-Click Unsubscribe'), + \Psr\Log\LogLevel::NOTICE, + 'fa-server' + ); + $message->addAction(ts('Learn more'), FALSE, 'href', ['url' => 'https://civicrm.org/redirect/unsubscribe-one-click'], 'fa-info-circle'); + $message->addAction(ts('Update settings'), FALSE, 'href', ['path' => 'civicrm/admin/mail', 'query' => 'reset=1'], 'fa-wrench'); + + return [$message]; + } + +} -- 2.25.1