Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
prepareHeadersAndTags example
$payload
[
'cc'
]
=
$this
->
stringifyAddresses
(
$emails
)
;
}
if
(
$emails
=
$email
->
getBcc
(
)
)
{
$payload
[
'bcc'
]
=
$this
->
stringifyAddresses
(
$emails
)
;
}
if
(
$email
->
getTextBody
(
)
)
{
$payload
[
'textContent'
]
=
$email
->
getTextBody
(
)
;
}
if
(
$email
->
getHtmlBody
(
)
)
{
$payload
[
'htmlContent'
]
=
$email
->
getHtmlBody
(
)
;
}
if
(
$headersAndTags
=
$this
->
prepareHeadersAndTags
(
$email
->
getHeaders
(
)
)
)
{
$payload
=
array_merge
(
$payload
,
$headersAndTags
)
;
}
return
$payload
;
}
private
function
prepareAttachments
(
Email
$email
)
: array
{
$attachments
=
[
]
;
foreach
(
$email
->
getAttachments
(
)
as
$attachment
)
{
$headers
=
$attachment
->
getPreparedHeaders
(
)
;
$payload
[
'cc'
]
=
$this
->
formatAddresses
(
$emails
)
;
}
if
(
$emails
=
$email
->
getBcc
(
)
)
{
$payload
[
'bcc'
]
=
$this
->
formatAddresses
(
$emails
)
;
}
if
(
$email
->
getTextBody
(
)
)
{
$payload
[
'textContent'
]
=
$email
->
getTextBody
(
)
;
}
if
(
$email
->
getHtmlBody
(
)
)
{
$payload
[
'htmlContent'
]
=
$email
->
getHtmlBody
(
)
;
}
if
(
$headersAndTags
=
$this
->
prepareHeadersAndTags
(
$email
->
getHeaders
(
)
)
)
{
$payload
=
array_merge
(
$payload
,
$headersAndTags
)
;
}
return
$payload
;
}
private
function
prepareAttachments
(
Email
$email
)
: array
{
$attachments
=
[
]
;
foreach
(
$email
->
getAttachments
(
)
as
$attachment
)
{
$headers
=
$attachment
->
getPreparedHeaders
(
)
;