Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email notification for quote fails due to "Language is not set" exception #1821

Closed
gadget60 opened this issue Dec 16, 2021 · 6 comments
Closed

Comments

@gadget60
Copy link
Contributor

Having an notification rule for type "quote" with an action "Email" throws an exception "MailActionProcessor: Language is not set" in:

if (null === $language) {
throw new \Exception('MailActionProcessor: Language is not set.');
}

Stack trace shows that the parameter "_locale" would have to be set in QuoteListener:

$this->rulesProcessor->applyRules('quote', $event->getSubject());

Something like:

        $quote = $event->getSubject();
        $this->rulesProcessor->applyRules('quote', $quote, [
            '_locale' => $quote->getLocaleCode(),
        ]);

...as it is is done in OrderWorkflowListener:

$this->rulesProcessor->applyRules('order', $order, [
'workflow' => $event->getWorkflowName(),
'fromState' => $event->getMarking()->getPlaces(),
'toState' => $event->getTransition()->getTos(),
'_locale' => $order->getLocaleCode(),
'recipient' => $customer->getEmail(),
'firstname' => $customer->getFirstname(),
'lastname' => $customer->getLastname(),
'orderNumber' => $order->getOrderNumber(),
'transition' => $event->getTransition()->getName(),
]);

Steps to reproduce:

  • create a notification of type "quote"
  • add an action "Mail"
  • as a customer, create a quote in the frontend
@dpfaffenbauer
Copy link
Member

are you on 2.x or 3.x?

@gadget60
Copy link
Contributor Author

On 2.x. BTW, also the "recipient" is required for the mail action...

@TobiSW
Copy link
Contributor

TobiSW commented Dec 22, 2021

For me also reproducable in 3.x

@dpfaffenbauer
Copy link
Member

PR #1868 fixes it for 2.2

@dpfaffenbauer
Copy link
Member

PR for 2.2 is merged

@dpfaffenbauer
Copy link
Member

PR for 3.x as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants