Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2368678
PhabricatorMailImplementationAmazonSESAdapter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorMailImplementationAmazonSESAdapter.php
View Options
<?php
final
class
PhabricatorMailImplementationAmazonSESAdapter
extends
PhabricatorMailImplementationPHPMailerLiteAdapter
{
private
$message
;
private
$isHTML
;
public
function
prepareForSend
()
{
parent
::
prepareForSend
();
$this
->
mailer
->
Mailer
=
'amazon-ses'
;
$this
->
mailer
->
customMailer
=
$this
;
}
public
function
supportsMessageIDHeader
()
{
// Amazon SES will ignore any Message-ID we provide.
return
false
;
}
protected
function
validateOptions
(
array
$options
)
{
PhutilTypeSpec
::
checkMap
(
$options
,
array
(
'access-key'
=>
'string'
,
'secret-key'
=>
'string'
,
'endpoint'
=>
'string'
,
));
}
public
function
newDefaultOptions
()
{
return
array
(
'access-key'
=>
null
,
'secret-key'
=>
null
,
'endpoint'
=>
null
,
);
}
public
function
newLegacyOptions
()
{
return
array
(
'access-key'
=>
PhabricatorEnv
::
getEnvConfig
(
'amazon-ses.access-key'
),
'secret-key'
=>
PhabricatorEnv
::
getEnvConfig
(
'amazon-ses.secret-key'
),
'endpoint'
=>
PhabricatorEnv
::
getEnvConfig
(
'amazon-ses.endpoint'
),
);
}
/**
* @phutil-external-symbol class SimpleEmailService
*/
public
function
executeSend
(
$body
)
{
$key
=
$this
->
getOption
(
'access-key'
);
$secret
=
$this
->
getOption
(
'secret-key'
);
$endpoint
=
$this
->
getOption
(
'endpoint'
);
$root
=
phutil_get_library_root
(
'phabricator'
);
$root
=
dirname
(
$root
);
require_once
$root
.
'/externals/amazon-ses/ses.php'
;
$service
=
new
SimpleEmailService
(
$key
,
$secret
,
$endpoint
);
$service
->
enableUseExceptions
(
true
);
return
$service
->
sendRawEmail
(
$body
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 6:42 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
443610
Default Alt Text
PhabricatorMailImplementationAmazonSESAdapter.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment