'nameDe' => 'Gutschrift',
],
MailTemplateTypes::MAILTYPE_DOCUMENT_CANCELLATION_INVOICE =>
[ 'typeId' => Uuid::
randomBytes(),
'templateId' => Uuid::
randomBytes(),
'name' => 'Cancellation invoice',
'nameDe' => 'Stornorechnung',
],
];
foreach ($documentTypeTranslationMapping as $technicalName =>
$values) { $existingTypeId =
$this->
getExistingMailTemplateTypeId($technicalName,
$connection);
if ($existingTypeId !== null
) { $values['typeId'
] =
$existingTypeId;
} else { $connection->
insert( 'mail_template_type',
[ 'id' =>
$values['typeId'
],
'technical_name' =>
$technicalName,
'available_entities' =>
json_encode(['order' => 'order', 'salesChannel' => 'sales_channel'
]),
'template_data' => '{"order":{"orderNumber":"10060","orderCustomer":{"firstName":"Max","lastName":"Mustermann"}},"salesChannel":{"name":"Storefront"}}',
'created_at'
=> (new \
DateTime())->
format(Defaults::STORAGE_DATE_TIME_FORMAT
),
]