Skip to content

Commit

Permalink
Add default replyToEmail
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Oct 31, 2024
1 parent 9035e2e commit 3d1a0a6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
];
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/SettingsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) ?? '',
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/models/SettingsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 3d1a0a6

Please sign in to comment.