From 00a187e18ae529f41f885a1f0910db5fa3d19ab8 Mon Sep 17 00:00:00 2001 From: bencroker Date: Thu, 31 Oct 2024 15:13:58 +0100 Subject: [PATCH] Add default `replyToEmail` --- src/Campaign.php | 6 +++--- src/helpers/SettingsHelper.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Campaign.php b/src/Campaign.php index 8f633f76..6bcde80f 100644 --- a/src/Campaign.php +++ b/src/Campaign.php @@ -390,9 +390,9 @@ protected function createSettingsModel(): SettingsModel $settings->apiKey = StringHelper::randomString(16); $settings->fromNamesEmails = [ [ - $mailSettings->fromName, - $mailSettings->fromEmail, - '', + $mailSettings->fromName ?? '', + $mailSettings->fromEmail ?? '', + $mailSettings->replyToEmail ?? '', Craft::$app->getSites()->getPrimarySite()->id, ], ]; diff --git a/src/helpers/SettingsHelper.php b/src/helpers/SettingsHelper.php index 5aad9dcb..b49b0bc1 100755 --- a/src/helpers/SettingsHelper.php +++ b/src/helpers/SettingsHelper.php @@ -57,9 +57,9 @@ public static function getFromNameEmail(int $siteId = null): array $mailSettings = App::mailSettings(); $firstFromNameEmail = [ - 'name' => App::parseEnv($mailSettings->fromName), - 'email' => App::parseEnv($mailSettings->fromEmail), - 'replyTo' => App::parseEnv($mailSettings->replyToEmail), + 'name' => App::parseEnv($mailSettings->fromName) ?? '', + 'email' => App::parseEnv($mailSettings->fromEmail) ?? '', + 'replyTo' => App::parseEnv($mailSettings->replyToEmail) ?? '', ]; }