From 74a8a0aefce42f632d68eabeeba9a6f9e64d5cf5 Mon Sep 17 00:00:00 2001 From: Brezo Cordero <8002881+brezocordero@users.noreply.github.com> Date: Fri, 26 Jan 2024 17:42:44 -0600 Subject: [PATCH] Modify context for Automations [MAILPOET-5796] --- .../Automation/Integrations/MailPoet/ContextFactory.php | 2 +- mailpoet/lib/Services/AuthorizedSenderDomainController.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mailpoet/lib/Automation/Integrations/MailPoet/ContextFactory.php b/mailpoet/lib/Automation/Integrations/MailPoet/ContextFactory.php index 50099d1261..6a6d4ecd7b 100644 --- a/mailpoet/lib/Automation/Integrations/MailPoet/ContextFactory.php +++ b/mailpoet/lib/Automation/Integrations/MailPoet/ContextFactory.php @@ -47,7 +47,7 @@ class ContextFactory { } private function getSenderDomainsConfig(): array { - $senderDomainsConfig = $this->authorizedSenderDomainController->getContextData(); + $senderDomainsConfig = $this->authorizedSenderDomainController->getContextDataForAutomations(); $senderDomainsConfig['authorizedEmails'] = $this->bridge->getAuthorizedEmailAddresses(); return $senderDomainsConfig; } diff --git a/mailpoet/lib/Services/AuthorizedSenderDomainController.php b/mailpoet/lib/Services/AuthorizedSenderDomainController.php index 9b269bea54..d1e6d7c72a 100644 --- a/mailpoet/lib/Services/AuthorizedSenderDomainController.php +++ b/mailpoet/lib/Services/AuthorizedSenderDomainController.php @@ -322,7 +322,14 @@ class AuthorizedSenderDomainController { 'upperLimit' => self::UPPER_LIMIT, 'isNewUser' => $this->isNewUser(), 'isEnforcementOfNewRestrictionsInEffect' => $this->isEnforcementOfNewRestrictionsInEffect(), + 'alwaysRewrite' => false, ], ]; } + + public function getContextDataForAutomations(): array { + $data = $this->getContextData(); + $data['senderRestrictions']['alwaysRewrite'] = true; + return $data; + } }