From 0f99446c92aef7a5851d6b37debabd1d2094b923 Mon Sep 17 00:00:00 2001 From: Martin Portius Date: Wed, 4 Oct 2023 14:53:33 +0200 Subject: [PATCH] allow option to skip encryption for mails --- src/MDMailerHelper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MDMailerHelper.php b/src/MDMailerHelper.php index 213e2ae..bd0d02b 100644 --- a/src/MDMailerHelper.php +++ b/src/MDMailerHelper.php @@ -21,6 +21,10 @@ final class MDMailerHelper { * @return string */ public static function pgp_encrypt(string $to, string $msg):string { + // Skip encryption if PGP_ENC_KEY is null + if (MD_CONF_EMAIL::PGP_ENC_KEY === null) { + return $msg; + } $gpg = new gnupg(); $gpg->seterrormode(GNUPG_ERROR_EXCEPTION); -- 2.34.1