From ba03e3eb0ac56c062f06a2cff1e69cbb0ea72f75 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Sat, 28 Apr 2018 14:09:54 +0100 Subject: [PATCH] Add CIVICRM_MAIL_LOG_AND_SEND constant to notification when sending test email --- CRM/Admin/Form/Setting/Smtp.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index 2af388a299..500eb282ff 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -115,10 +115,9 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting { $to = '"' . $toDisplayName . '"' . "<$toEmail>"; $from = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>'; - $testMailStatusMsg = ts('Sending test email. FROM: %1 TO: %2.
', array( - 1 => $domainEmailAddress, - 2 => $toEmail, - )); + $testMailStatusMsg = ts('Sending test email') . ':
' + . ts('From: %1', array(1 => $domainEmailAddress)) . '
' + . ts('To: %1', array(1 => $toEmail)) . '
'; $params = array(); if ($formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_SMTP) { @@ -170,7 +169,10 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting { $errorScope = CRM_Core_TemporaryErrorScope::ignoreException(); $result = $mailer->send($toEmail, $headers, $message); unset($errorScope); - if (defined('CIVICRM_MAIL_LOG')) { + if (defined('CIVICRM_MAIL_LOG') && defined('CIVICRM_MAIL_LOG_AND_SEND')) { + $testMailStatusMsg .= '
' . ts('You have defined CIVICRM_MAIL_LOG_AND_SEND - mail will be logged.') . '

'; + } + if (defined('CIVICRM_MAIL_LOG') && !defined('CIVICRM_MAIL_LOG_AND_SEND')) { CRM_Core_Session::setStatus($testMailStatusMsg . ts('You have defined CIVICRM_MAIL_LOG - no mail will be sent. Your %1 settings have not been tested.', array(1 => strtoupper($mailerName))), ts("Mail not sent"), "warning"); } elseif (!is_a($result, 'PEAR_Error')) { -- 2.25.1