Merge pull request 'allow option to skip encryption for mails' (#1) from mportius/MDMailer:master into master

Reviewed-on: #1

Close #2
This commit is contained in:
Joshua Ramon Enslin 2023-10-05 02:05:00 +02:00
commit 900c2733e5

View File

@ -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);