diff --git a/locale/messages.po b/locale/messages.po index b5b59914d5..282b2d3468 100644 --- a/locale/messages.po +++ b/locale/messages.po @@ -10,7 +10,7 @@ msgstr "" "#-#-#-#-# messages.po (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-08 14:45-0800\n" +"POT-Creation-Date: 2024-12-08 14:46-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,8 +25,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-12-08T22:45:34.521Z\n" -"PO-Revision-Date: 2024-12-08T22:45:34.522Z\n" +"POT-Creation-Date: 2024-12-08T22:46:39.101Z\n" +"PO-Revision-Date: 2024-12-08T22:46:39.102Z\n" "Language: en\n" msgid "Backup Database" @@ -5083,6 +5083,9 @@ msgstr "" msgid "SMTP Host is not setup, please visit the settings page" msgstr "" +msgid "Church Email not set, please visit the settings page" +msgstr "" + msgid "Debug Email Connection" msgstr "" diff --git a/src/v2/routes/email.php b/src/v2/routes/email.php index 1b09921920..469e16ab1d 100644 --- a/src/v2/routes/email.php +++ b/src/v2/routes/email.php @@ -5,6 +5,7 @@ use ChurchCRM\dto\SystemURLs; use ChurchCRM\Service\MailChimpService; use ChurchCRM\Slim\Middleware\Request\Auth\AdminRoleAuthMiddleware; +use ChurchCRM\Utils\LoggerUtils; use PHPMailer\PHPMailer\PHPMailer; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; @@ -45,14 +46,18 @@ function testEmailConnectionMVC(Request $request, Response $response, array $arg $mailer = new PHPMailer(); $message = ''; - if (!empty(SystemConfig::getValue('sSMTPHost')) && !empty(ChurchMetaData::getChurchEmail())) { + if (empty(SystemConfig::getValue('sSMTPHost'))) { + $message = gettext('SMTP Host is not setup, please visit the settings page'); + } elseif (empty(ChurchMetaData::getChurchEmail())) { + $message = gettext('Church Email not set, please visit the settings page'); + } else { $mailer->IsSMTP(); $mailer->CharSet = 'UTF-8'; $mailer->Timeout = intval(SystemConfig::getValue('iSMTPTimeout')); $mailer->Host = SystemConfig::getValue('sSMTPHost'); if (SystemConfig::getBooleanValue('bSMTPAuth')) { $mailer->SMTPAuth = true; - echo 'SMTP Auth Used
'; + LoggerUtils::getAppLogger()->debug('SMTP Auth Used'); $mailer->Username = SystemConfig::getValue('sSMTPUser'); $mailer->Password = SystemConfig::getValue('sSMTPPass'); } @@ -63,8 +68,6 @@ function testEmailConnectionMVC(Request $request, Response $response, array $arg $mailer->addAddress(ChurchMetaData::getChurchEmail()); $mailer->Body = 'test email'; $mailer->Debugoutput = 'html'; - } else { - $message = gettext('SMTP Host is not setup, please visit the settings page'); } $pageArgs = [