mailer->Mailer = 'amazon-ses'; $this->mailer->customMailer = $this; } public function supportsMessageIDHeader() { // Amazon SES will ignore any Message-ID we provide. return false; } /** * @phutil-external-symbol class Aws\Ses\SesClient */ public function executeSend($body) { // Instead of introducing new config option, we use the endpoint config for // @{class:PhabricatorMailImplementationAmazonSESAdapter} to get region // information. So it will be eaiser for us to migrate our code later. $endpoint = PhabricatorEnv::getEnvConfig('amazon-ses.endpoint'); if (!$endpoint) { throw new Exception( pht( "Configure '%s' to use Amazon SES for mail delivery.", 'amazon-ses.endpoint')); } $region = idx(explode('.', $endpoint), 1); $client = new Aws\Ses\SesClient([ 'region' => $region, 'version' => self::API_VERSION, ]); return $client->sendRawEmail([ 'RawMessage' => [ 'Data' => $body, ], ]); } }