controller/jobs/src/Controller/Jobs/Order/Email/Voucher/Standard.php
protected function sendEmails( \Aimeos\MShop\Order\Item\Base\Iface $orderBaseItem, \Aimeos\Client\Html\Iface $client )
	{
		$context = $this->getContext();
		$addrItem = $this->getAddressItem( $orderBaseItem );
		$currencyId = $orderBaseItem->getPrice()->getCurrencyId();
		$langId = ( $addrItem->getLanguageId() ?: $orderBaseItem->getLocale()->getLanguageId() );

		$view = $this->getView( $context, $orderBaseItem->getSiteCode(), $currencyId, $langId );

		foreach( $orderBaseItem->getProducts() as $orderProductItem )
		{
			if( $orderProductItem->getType() === 'voucher'
				&& ( $codes = $orderProductItem->getAttribute( 'coupon-code', 'coupon' ) ) !== null
			) {
				foreach( (array) $codes as $code )
				{
					$message = $context->getMail()->createMessage();
					$view->addHelper( 'mail', new \Aimeos\MW\View\Helper\Mail\Standard( $view, $message ) );

					$view->extOrderProductItem = $orderProductItem;
					$view->extAddressItem = $addrItem;
					$view->extVoucherCode = $code;

					$client->setView( $view );
					$client->getHeader();
					$client->getBody();

					$context->getMail()->send( $view->mail() );
				}
			}
		}
	}
protected function sendEmails( \Aimeos\MShop\Order\Item\Base\Iface $orderBaseItem, \Aimeos\Client\Html\Iface $client )
	{
		$context = $this->getContext();
		$addrItem = $this->getAddressItem( $orderBaseItem );
		$currencyId = $orderBaseItem->getPrice()->getCurrencyId();
		$langId = ( $addrItem->getLanguageId() ?: $orderBaseItem->getLocale()->getLanguageId() );

		$view = $this->getView( $context, $orderBaseItem->getSiteCode(), $currencyId, $langId );

		foreach( $orderBaseItem->getProducts() as $orderProductItem )
		{
			if( $orderProductItem->getType() === 'voucher'
				&& ( $codes = $orderProductItem->getAttribute( 'coupon-code', 'coupon' ) ) !== null
			) {
				foreach( (array) $codes as $code )
				{
					$message = $context->getMail()->createMessage();
					$view->addHelper( 'mail', new \Aimeos\MW\View\Helper\Mail\Standard( $view, $message ) );

					$view->extOrderProductItem = $orderProductItem;
					$view->extAddressItem = $addrItem;
					$view->extVoucherCode = $code;

					$client->setView( $view );
					$client->getHeader();
					$client->getBody();

					$context->getMail()->send( $view->mail() );
				}
			}
		}
	}
protected function sendEmails ( \ Aimeos \ MShop \ Order \ Item \ Base \ Iface $ orderBaseItem , \ Aimeos \ Client \ Html \ Iface $ client ) { $ context = $ this -> getContext ( ) ; $ addrItem = $ this -> getAddressItem ( $ orderBaseItem ) ; $ currencyId = $ orderBaseItem -> getPrice ( ) -> getCurrencyId ( ) ; $ langId = ( $ addrItem -> getLanguageId ( ) ? : $ orderBaseItem -> getLocale ( ) -> getLanguageId ( ) ) ; $ view = $ this -> getView ( $ context , $ orderBaseItem -> getSiteCode ( ) , $ currencyId , $ langId ) ; foreach ( $ orderBaseItem -> getProducts ( ) as $ orderProductItem ) { if ( $ orderProductItem -> getType ( ) === 'voucher' && ( $ codes = $ orderProductItem -> getAttribute ( 'coupon-code' , 'coupon' ) ) !== null ) { foreach ( ( array ) $ codes as $ code ) { $ message = $ context -> getMail ( ) -> createMessage ( ) ; $ view -> addHelper ( 'mail' , new \ Aimeos \ MW \ View \ Helper \ Mail \ Standard ( $ view , $ message ) ) ; $ view -> extOrderProductItem = $ orderProductItem ; $ view -> extAddressItem = $ addrItem ; $ view -> extVoucherCode = $ code ; $ client -> setView ( $ view ) ; $ client -> getHeader ( ) ; $ client -> getBody ( ) ; $ context -> getMail ( ) -> send ( $ view -> mail ( ) ) ; } } } }
Sends the voucher related e-mail for a single order

@param \Aimeos\MShop\Order\Item\Base\Iface $orderBaseItem Complete order including addresses, products, services
@param \Aimeos\Client\Html\Iface $client HTML client object for rendering the voucher e-mails
Sends the voucher related e - mail for a single order