• andrewlakomski

    (@andrewlakomski)


    Hi, after last update of Mailpoet my automation on transactional emails stopped working.

    Following documentation: “If you are adding an action to send an email?immediately?following?the order status change trigger, then this email will be considered “Transactional”, meaning that it will be sent to all subscribers regardless of whether they are in “Subscribed” status or not.” But it obviously not working that way:

    {"message":"Subscriber ID '50173' is not subscribed to segment ID '2'.","errorClass":"MailPoet\\InvalidStateException","code":0,"trace":[{"file":"/wp-content/plugins/mailpoet/lib/Automation/Integrations/MailPoet/Actions/SendEmailAction.php","line":180,"function":"create","class":"MailPoet\\Exception","type":"::"},{"file":"/wp-content/plugins/mailpoet/lib/Automation/Integrations/MailPoet/Actions/SendEmailAction.php","line":140,"function":"getSubscriber","class":"MailPoet\\Automation\\Integrations\\MailPoet\\Actions\\SendEmailAction","type":"->"},{"file":"/wp-content/plugins/mailpoet/lib/Automation/Engine/Control/StepHandler.php","line":154,"function":"run","class":"MailPoet\\Automation\\Integrations\\MailPoet\\Actions\\SendEmailAction","type":"->"},{"file":"/wp-content/plugins/mailpoet/lib/Automation/Engine/Control/StepHandler.php","line":96,"function":"handleStep","class":"MailPoet\\Automation\\Engine\\Control\\StepHandler","type":"->"},{"file":"/wp-includes/class-wp-hook.php","line":324,"function":"handle","class":"MailPoet\\Automation\\Engine\\Control\\StepHandler","type":"->"},{"file":"/wp-includes/class-wp-hook.php","line":348,"function":"apply_filters","class":"WP_Hook","type":"->"},{"file":"/wp-includes/plugin.php","line":565,"function":"do_action","class":"WP_Hook","type":"->"},{"file":"/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_Action.php","line":26,"function":"do_action_ref_array"},{"file":"/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php","line":34,"function":"execute","class":"ActionScheduler_Action","type":"->"},{"file":"/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueRunner.php","line":79,"function":"process_action","class":"ActionScheduler_Abstract_QueueRunner","type":"->"},{"file":"/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueRunner.php","line":63,"function":"do_batch","class":"ActionScheduler_QueueRunner","type":"->"},{"file":"/wp-includes/class-wp-hook.php","line":324,"function":"run","class":"ActionScheduler_QueueRunner","type":"->"},{"file":"/wp-includes/class-wp-hook.php","line":348,"function":"apply_filters","class":"WP_Hook","type":"->"},{"file":"/wp-includes/plugin.php","line":565,"function":"do_action","class":"WP_Hook","type":"->"},{"file":"/wp-cron.php","line":191,"function":"do_action_ref_array"}]}

    My automation has only two steps – after status change -> send email.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Shohan Hossain Nabil – a11n

    (@sohanhossain)

    Hello,

    Could you please confirm if it was working correctly on the previous version? Also, could you please take screenshots of your current configuration and share them here? We will try to reproduce the scenario on our test sites.

    Thanks!

    Thread Starter andrewlakomski

    (@andrewlakomski)

    I’m sure that it was working before because we have mailing with discount code after purchasing one of our products set with this automation and it was working well ??

    I don’t think that this is configuration problem – maybe it’s because a customer is not added to proper segment while placing an order – I’ve found it and (for now, because we’ve halted newsletters) suppressed errors by simply overwriting getSubscriber method in SendEmailAction like that:

    private function getSubscriber(StepRunArgs $args): SubscriberEntity
      {
          // hack for transactional email fail
          $subscriberId = $args->getSinglePayloadByClass(SubscriberPayload::class)->getId();
          $subscriber   = $this->subscribersRepository->findOneById($subscriberId);
          if (!$subscriber) {
              throw InvalidStateException::create();
          }
          return $subscriber;
      }

    I’m pretty sure that the problem is when customer places an order his address is not added to “WooCommerce Customers” list. Then the check by segments will fail.

    Plugin Support B C. a11n

    (@battouly)

    Hi @andrewlakomski,

    I don’t think that this is configuration problem – maybe it’s because a customer is not added to proper segment while placing an order?

    That could be the reason here. Because, a confirmed customer is required:

    WooCommerce Automatic emails created with MailPoet will be sent only to “Subscribed” users.??If they’re still “Unconfirmed”, the email will be scheduled but not sent until they confirm their subscription via email (if double opt-in is enabled).

    Also,??the emails will be triggered only if the order status is “Processing” or “Completed”.

    https://kb.mailpoet.com/article/277-woocommerce-automatic-emails

    If all others are sending correctly, then we can rule out a configuration or plugin issue.

    Thread Starter andrewlakomski

    (@andrewlakomski)

    I think you miss the point. It’s not about sending emails to my subscribers, but transactional email -> https://kb.mailpoet.com/article/397-how-to-set-up-an-automation#order-status-change

    Where you guys said that “If you are adding an action to send an email immediately following the order status change trigger, then this email will be considered “Transactional”, meaning that it will be sent to all subscribers regardless of whether they are in “Subscribed” status or not.”

    My automation looks like this:

    So in this case email SHOULD BE SENT no matter what status is for subscriber. And it’s not.

    Transactional emails should not depend on what status subscriber is in.

    Plugin Support Ojoma a11n

    (@geraltrivia)

    Hello there @andrewlakomski

    So in this case email SHOULD BE SENT no matter what status is for subscriber. And it’s not.

    Transactional emails should not depend on what status subscriber is in.

    Yes, you are correct. Using the order status trigger, the first email which is termed as transaction will be sent irrespective of the subscriber status.

    Can you let us know what trigger settings / filters you’ve setup up for our “order status trigger”

    Can you also confirm if your able to send other emails and only this automation isn’t working?

    For the Discount code email I can see your From email address is set to “my email ;). Did you type that in deliberately because you were sharing your screenshot on a public forum? If yes, all good there!

    Looking forward to hearing back from you.

    Thread Starter andrewlakomski

    (@andrewlakomski)

    Hi,

    That’s my trigger settings (it’s default, for one product):

    “My email ;)” is indeed because it’s public forum, all settings are correct and we’re sending other mailings to our subscribers and all woocommerce emails through mailpoet.

    Using the order status trigger, the first email which is termed as transaction will be sent irrespective of the subscriber status.

    But it’s not – check the code ?? It’s always checking subscriber status ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Transactional emails not working in automation’ is closed to new replies.