<?php

namespace KupShop\KupShopBundle\Email;

class OrderChangeEmail extends OrderEmail
{
    protected static $name = 'Změna stavu objednávky';
    protected static $type = 'ORDER_STATUS_CHANGE';
    protected static $priority = 9;

    protected $subject = 'Vaše objednávka {KOD} je v pohybu';
    protected $template = 'email/email_order_change.tpl';

    public function getMicrodata(): array
    {
        if ($microdata = parent::getMicrodata()) {
            if (in_array($this->getOrder()->status, getStatuses('handled'))) {
                $microdata['orderStatus'] = 'https://schema.org/OrderInTransit';
            }
        }

        return $microdata;
    }
}
