Skip to content

Commit

Permalink
Merge branch '2.x' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	composer.json
  • Loading branch information
bencroker committed Aug 2, 2024
2 parents 3f30ec4 + 1c846d0 commit 3ed0d29
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 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

## 3.4.2 - 2024-08-02

### Changed

- IP addresses are now logged in failed webhook requests from Postmark.

## 3.4.1 - 2024-07-15

### Changed
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": "3.4.1",
"version": "3.4.2",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/campaign",
"license": "proprietary",
Expand Down
7 changes: 5 additions & 2 deletions src/controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,11 @@ public function actionPostmark(): ?Response
// https://postmarkapp.com/support/article/800-ips-for-firewalls#webhooks
$allowedIpAddresses = Campaign::$plugin->settings->postmarkAllowedIpAddresses;

if ($allowedIpAddresses && !in_array($this->request->getRemoteIP(), $allowedIpAddresses)) {
return $this->asRawFailure('IP address not allowed.');
if ($allowedIpAddresses !== null) {
$ipAddress = $this->request->getRemoteIP();
if (!in_array($ipAddress, $allowedIpAddresses)) {
return $this->asRawFailure(Craft::t('campaign', 'IP address not allowed. [{ipAddress}]', ['ipAddress' => $ipAddress]));
}
}

$eventType = $this->request->getBodyParam('RecordType');
Expand Down
2 changes: 1 addition & 1 deletion src/services/SendoutsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public function sendNotification(SendoutElement $sendout): void
$variables = [
'title' => $sendout->title,
'emailSettingsUrl' => UrlHelper::cpUrl('campaign/settings/email'),
'sendoutUrl' => $sendout->cpEditUrl,
'sendoutUrl' => $sendout->getCpEditUrl(),
'sendAttempts' => Campaign::$plugin->settings->maxSendAttempts,
];

Expand Down

0 comments on commit 3ed0d29

Please sign in to comment.