Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
Enlight_Components_Mail example
return
null;
}
if
(
isset
(
$options
[
'charset'
]
)
)
{
$defaultCharSet
=
$options
[
'charset'
]
;
}
elseif
(
!
empty
(
$config
->
get
(
'CharSet'
)
)
)
{
$defaultCharSet
=
$config
->
get
(
'CharSet'
)
;
}
else
{
$defaultCharSet
= null;
}
return
new
Enlight_Components_Mail
(
$defaultCharSet
,
$config
->
get
(
'mailer_hostname'
)
?: null
)
;
}
}
/** @var Shopware_Components_Config $config */
$config
=
$this
->
get
(
\Shopware_Components_Config::
class
)
;
$logLevel
= \Monolog\Logger::
toMonologLevel
(
$config
->
get
(
'logMailLevel'
)
)
;
$recipients
=
array_filter
(
explode
(
"\n",
$config
->
get
(
'logMailAddress'
)
)
)
;
if
(
\
count
(
$recipients
)
< 1
)
{
$recipients
[
]
=
$config
->
get
(
'mail'
)
;
}
$mailer
=
new
\
Enlight_Components_Mail
(
)
;
$mailer
->
addTo
(
$recipients
)
;
$mailer
->
setSubject
(
'Error in shop "' .
$config
->
get
(
'shopName'
)
. '".'
)
;
$mailHandler
=
new
EnlightMailHandler
(
$mailer
,
$logLevel
)
;
$mailHandler
->
pushProcessor
(
new
ShopwareEnvironmentProcessor
(
)
)
;
$mailHandler
->
setFormatter
(
new
HtmlFormatter
(
)
)
;
return
new
BufferHandler
(
$mailHandler
, 0, Logger::ERROR
)
;
}
}