Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi all, Does anyone know when the confirmation email is sent after an order is placed and what class

Options
U04TQ9UG04U
U04TQ9UG04U Posts: 25 🧑🏻‍🚀 - Cadet

Hi all,
Does anyone know when the confirmation email is sent after an order is placed and what class sends it ?
I'm placing debuging breakpoints in the mailer Class but the code never flows through it.

Comments

  • U01T075RRHD
    U01T075RRHD Posts: 118 🧑🏻‍🚀 - Cadet
    edited March 2023
    Options

    This is done asynchronously from the OMS state-machine. You need to debug the command console oms:check-condition, I believe

  • U04TQ9UG04U
    U04TQ9UG04U Posts: 25 🧑🏻‍🚀 - Cadet
    Options

    Thanks! I'll give it a shot.

  • U04BT4XGQF8
    U04BT4XGQF8 Posts: 13 🧑🏻‍🚀 - Cadet
    Options

    Also if you run the containers in debug mode with docker/sdk up -x you can use breakpoints with background processes as well

  • U04TQ9UG04U
    U04TQ9UG04U Posts: 25 🧑🏻‍🚀 - Cadet
    Options

    @U01T075RRHD I got my hands on the code since yesterday, but fail to understand the purpose of the command you sent.
    If I understand correctly though, the confirmation email is not sent right after the checkout success, but rather via another module when the order is effectively placed, correct ?

    @U04BT4XGQF8 I've just recently started using xdebug, and am loving it ! I'm using break points but if I don't know where in the code the email is sent, how do I know where to put a break point? Furthermore, what are the "background processes" you mentionned ?

  • U04BT4XGQF8
    U04BT4XGQF8 Posts: 13 🧑🏻‍🚀 - Cadet
    edited March 2023
    Options

    You'll find the OMS flow defined in an .xml file in the config/Zed/oms folder. Under , there are items like:

    <event name="confirm" onEnter="true" manual="true" command="Oms/SendOrderConfirmation"/>
    

    The command part is defined in OmsDependencyProvider::extendCommandPlugins where you'll also see what actual class it uses, which in this case is \Spryker\Zed\Oms\Communication\Plugin\Oms\Command\SendOrderConfirmationPlugin. This is one place you can put a breakpoint (the class file)

  • U01T075RRHD
    U01T075RRHD Posts: 118 🧑🏻‍🚀 - Cadet
    Options

    Try looking for Oms/SendOrderConfirmation in the code base. You will find a mapping to a class that you can start debugging

  • U04BT4XGQF8
    U04BT4XGQF8 Posts: 13 🧑🏻‍🚀 - Cadet
    Options

    And by background process in this case I mean, that if and when there are parts of the OMS flow that are not run back-to-back ( has onEnter="true") but rather scheduled ( has timeout=something), your xdebug breakpoint won't trigger since that request isn't (necessarily - there are of course exceptions...) sent from your browser

  • U04TQ9UG04U
    U04TQ9UG04U Posts: 25 🧑🏻‍🚀 - Cadet
    Options

    Thanks for your help !
    I understand the process better now and managed to implement the changes I needed 👍