$connection->
insert( 'mail_template_type',
[ 'id' =>
$templateTypeId,
'technical_name' => 'guest_order.double_opt_in',
'available_entities' =>
$this->
getAvailableEntities(),
'created_at'
=> (new \
DateTime())->
format(Defaults::STORAGE_DATE_TIME_FORMAT
),
] );
$defaultLanguageId = Uuid::
fromHexToBytes(Defaults::LANGUAGE_SYSTEM
);
$englishLanguageId =
$this->
fetchLanguageIdByName(self::ENGLISH_LANGUAGE_NAME,
$connection);
$germanLanguageId =
$this->
fetchLanguageIdByName(self::GERMAN_LANGUAGE_NAME,
$connection);
if (!\
in_array($defaultLanguageId,
[$englishLanguageId,
$germanLanguageId], true
)) { $connection->
insert( 'mail_template_type_translation',
[ 'mail_template_type_id' =>
$templateTypeId,
'language_id' =>
$defaultLanguageId,
'name' => 'Double opt in guest order',