Twig money filter not available in order_confirmation mail


#1

hey friends of spryker :slight_smile:

i want send the order confirmation to the user after the order is placed. i have create a new state that called “order placed”.

<transition happy="true">
                <source>new</source>
                <target>order placed</target>
                <event>placing order</event>
            </transition>

            <transition happy="true" condition="Prepayment/IsAuthorized">
                <source>order placed</source>
                <target>payment pending</target>
                <event>authorize</event>
            </transition>
           ...
           <event name="placing order" onEnter="true" command="Oms/SendOrderConfirmation"/>

while sending the email i got a exception “Unknown “money” filter in…”, i can not explain it. On default the email will be send after submitting the payment in ZED, and works fine.


#2

Solution:

<?php

namespace Pyz\Zed\Application;

// ...

class ApplicationDependencyProvider extends SprykerApplicationDependencyProvider {

	// ...

	protected function getInternalCallServiceProviders(Container $container)
    {
		return [
			// ...
			new TwigMoneyServiceProvider()
			// ...
		];
    }
}