diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dbbe615..538fa8d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/composer.json b/composer.json index 8517d2c0..084be03b 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": "3.4.1", + "version": "3.4.2", "type": "craft-plugin", "homepage": "https://putyourlightson.com/plugins/campaign", "license": "proprietary", diff --git a/src/controllers/WebhookController.php b/src/controllers/WebhookController.php index 7681cff6..77317ef8 100755 --- a/src/controllers/WebhookController.php +++ b/src/controllers/WebhookController.php @@ -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'); diff --git a/src/services/SendoutsService.php b/src/services/SendoutsService.php index 4a5c1644..d81b6478 100755 --- a/src/services/SendoutsService.php +++ b/src/services/SendoutsService.php @@ -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, ];