diff --git a/CHANGELOG.md b/CHANGELOG.md index b6cc1345..104c1c8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Release Notes for Campaign +## 2.17.7 - 2024-10-31 + +### Changed + +- The “from names and emails” setting now accepts environment variables ([#503](https://github.com/putyourlightson/craft-campaign/issues/503)). + ## 2.17.6 - 2024-10-08 ### Fixed diff --git a/composer.json b/composer.json index c495c051..4d1bbfcc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "putyourlightson/craft-campaign", "description": "Send and manage email campaigns, contacts and mailing lists.", - "version": "2.17.6", + "version": "2.17.7", "type": "craft-plugin", "homepage": "https://putyourlightson.com/plugins/campaign", "license": "proprietary", diff --git a/src/Campaign.php b/src/Campaign.php index d280383c..ba78d7f8 100644 --- a/src/Campaign.php +++ b/src/Campaign.php @@ -401,9 +401,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) ?? '', ]; } diff --git a/src/models/SettingsModel.php b/src/models/SettingsModel.php index e467366f..00f89dba 100644 --- a/src/models/SettingsModel.php +++ b/src/models/SettingsModel.php @@ -456,7 +456,7 @@ public function getTurnstileErrorMessage(): string /** * Returns the parsed from names and emails. * - * @since 3.5.6 + * @since 2.17.7 */ public function getFromNamesEmails(): array {