Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createSimpleMailTemplate example
int
$count
= 500
)
: void
{
$context
->
getConsole
(
)
->
progressStart
(
$count
)
;
$criteria
=
new
Criteria
(
)
;
$criteria
->
addFilter
(
new
EqualsFilter
(
'mail_template_type.mailTemplates.id', null
)
)
;
$mailTypeIds
=
$this
->mailTemplateTypeRepository->
search
(
$criteria
,
$context
->
getContext
(
)
)
->
getIds
(
)
;
$payload
=
[
]
;
foreach
(
$mailTypeIds
as
$mailTypeId
)
{
$payload
[
]
=
$this
->
createSimpleMailTemplate
(
$context
,
$mailTypeId
)
;
if
(
\
count
(
$payload
)
>= 10
)
{
$context
->
getConsole
(
)
->
progressAdvance
(
\
count
(
$payload
)
)
;
$this
->
write
(
$payload
,
$context
)
;
$payload
=
[
]
;
}
}
if
(
!
empty
(
$payload
)
)
{
$this
->
write
(
$payload
,
$context
)
;
}