Created
November 3, 2014 06:06
-
-
Save nachopants/1fbae666b555e9f22dc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Heffron\Bundle\AWSBundle\Controller; | |
use FOS\RestBundle\Controller\FOSRestController; | |
use Aws\Ses\SesClient; | |
/** | |
* AWS SES Controller. | |
* | |
*/ | |
class SesController extends FOSRestController | |
{ | |
public function getDeliverAction() | |
{ | |
$aws = $this->get('platinum_pixs_aws.ses'); | |
$awsClient = $aws->get('Ses'); | |
$result = $awsClient->sendEmail(array( | |
// Source is required | |
'Source' => 'no-reply@heffron.com.au', | |
// Destination is required | |
'Destination' => array( | |
'ToAddresses' => array('andrew.smith@heffron.com.au'), | |
'CcAddresses' => array(), | |
'BccAddresses' => array(), | |
), | |
// Message is required | |
'Message' => array( | |
// Subject is required | |
'Subject' => array( | |
// Data is required | |
'Data' => 'My Test Email', | |
'Charset' => 'UTF-8', | |
), | |
// Body is required | |
'Body' => array( | |
'Text' => array( | |
// Data is required | |
'Data' => 'My Test Email Body', | |
'Charset' => 'UTF-8', | |
), | |
'Html' => array( | |
// Data is required | |
'Data' => 'My Test Email Body', | |
'Charset' => 'UTF-8', | |
), | |
), | |
), | |
'ReplyToAddresses' => array('no-reply@heffron.com.au'), | |
'ReturnPath' => 'no-reply@heffron.com.au', | |
)); | |
$view = $this->view($result, 200); | |
return $this->handleView($view); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment