Skip to content

Instantly share code, notes, and snippets.

@nachopants
Created November 3, 2014 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nachopants/1fbae666b555e9f22dc8 to your computer and use it in GitHub Desktop.
Save nachopants/1fbae666b555e9f22dc8 to your computer and use it in GitHub Desktop.
<?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