When adding a new newsletter to Magento via custom module,
Observer NewsletterSubscribeObserver not called, but after saving newsletter to the Magento calls another Observer UserProfileNewsletterSubscribeObserver and try to get a customer by ID, Magento throws Exception because a customer with ID=0 doesn't exist.
Description: This PR continues https://github.com/klaviyo/magento2-klaviyo/pull/56 with the adoption of recent changes inside the module.
When adding a new newsletter to Magento via custom module, Observer NewsletterSubscribeObserver not called, but after saving newsletter to the Magento calls another Observer UserProfileNewsletterSubscribeObserver and try to get a customer by ID, Magento throws Exception because a customer with ID=0 doesn't exist.
The full exception looks like this:
As a result, we have 2 issues:
Related issues
Also fixes #19
Steps to reproduce:
Expected result: Email what was subscribed should get "Welcome email."
Actual result: "Welcome email" doesn't send