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..

Hey y’all triggering an email/notification send in my OMS state tree, it’s sending an email but it l

U01JBB8LNTE
U01JBB8LNTE Posts: 207 🧑🏻‍🚀 - Cadet

Hey y’all triggering an email/notification send in my OMS state tree, it’s sending an email but it looks like it’s not wired up correctly to the CMS to run the template.

I’m using the standard spryker OMS confirmation.

but maybe it’s not keyed correctly?

The type is being set to $mailTransfer->setType(OrderConfirmationMailTypePlugin::MAIL_TYPE);

which I think is overriding the base spryker class

class OrderConfirmationMailTypePlugin extends SprykerOrderConfirmationMailTypePlugin
{
    /**
     * @api
     *
     * @param \Spryker\Zed\Mail\Business\Model\Mail\Builder\MailBuilderInterface $mailBuilder
     *
     * @return void
     */
    public function build(MailBuilderInterface $mailBuilder)
    {
        $this
            ->setSubject($mailBuilder)
            ->setRecipient($mailBuilder)
            ->setSender($mailBuilder);

setHtmlTemplate doesn’t exist in the extended class, but…

in the base spryker class it looks like the template is getting set

    protected function setHtmlTemplate(MailBuilderInterface $mailBuilder)
    {
        $mailBuilder->setHtmlTemplate('oms/mail/order_confirmation.html.twig');

        return $this;
    }

which should be referenced to the local order_confirmation html:

src/Pyz/Zed/Oms/Presentation/Mail/order_confirmation.html.twig

Which is the same as the base html template

https://github.com/spryker-shop/b2c-demo-shop/blob/master/src/Pyz/Zed/Oms/Presentation/Mail/order_confirmation.html.twig

Comments

  • U01JBB8LNTE
    U01JBB8LNTE Posts: 207 🧑🏻‍🚀 - Cadet

    So far I’ve tried removing the override for the OrderConfirmationMailTypePlugin that was aliased in the local files

  • U01JBB8LNTE
    U01JBB8LNTE Posts: 207 🧑🏻‍🚀 - Cadet

    Running my own confirmationCall with overrides for the setHtmlTemplate