Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getAwsCode example
protected
function
doSend
(
SentMessage
$message
)
: void
{
$result
=
$this
->sesClient->
sendEmail
(
$this
->
getRequest
(
$message
)
)
;
$response
=
$result
->
info
(
)
[
'response'
]
;
try
{
$message
->
setMessageId
(
$result
->
getMessageId
(
)
)
;
$message
->
appendDebug
(
$response
->
getInfo
(
'debug'
)
?? ''
)
;
}
catch
(
HttpException
$e
)
{
$exception
=
new
HttpTransportException
(
sprintf
(
'Unable to send an email: %s (code %s).',
$e
->
getAwsMessage
(
)
?:
$e
->
getMessage
(
)
,
$e
->
getAwsCode
(
)
?:
$e
->
getCode
(
)
)
,
$e
->
getResponse
(
)
,
$e
->
getCode
(
)
,
$e
)
;
$exception
->
appendDebug
(
$e
->
getResponse
(
)
->
getInfo
(
'debug'
)
?? ''
)
;
throw
$exception
;
}
}
protected
function
getRequest
(
SentMessage
$message
)
: SendEmailRequest
{
$request
=
[
'Destination' =>
new
Destination
(
[
'ToAddresses' =>
$this
->
stringifyAddresses
(
$message
->
getEnvelope
(
)
->
getRecipients
(
)
)
,
]
)
,