Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setSentAt example
/** * {@inheritdoc} */
public
function
build
(
Enlight_Components_Mail
$mail
)
: Log
{
$logEntry
=
new
Log
(
)
;
$logEntry
->
setSubject
(
(string)
iconv_mime_decode
(
(string)
$mail
->
getSubject
(
)
)
)
;
$logEntry
->
setSender
(
$mail
->
getFrom
(
)
)
;
$logEntry
->
setSentAt
(
new
DateTime
(
(string)
$mail
->
getDate
(
)
)
)
;
$logEntry
->
setContentText
(
$mail
->
getPlainBodyText
(
)
)
;
if
(
$mail
->
getBodyHtml
(
)
instanceof Zend_Mime_Part
)
{
$logEntry
->
setContentHtml
(
$mail
->
getBodyHtml
(
)
->
getRawContent
(
)
)
;
}
$this
->
assignType
(
$logEntry
,
$mail
->
getTemplateName
(
)
)
;
$this
->
assignOrder
(
$logEntry
,
$mail
)
;
$this
->
assignShop
(
$logEntry
,
$mail
)
;
$this
->
assignRecipients
(
$logEntry
,
array_map
(
'trim',
$mail
->
getRecipients
(
)
)
)
;