PHP code example of daily / hipaway-mandrill-bundle
1. Go to this page and download the library: Download daily/hipaway-mandrill-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
daily / hipaway-mandrill-bundle example snippets
// src/Hip/ExampleBundle/Controller/ExampleController.php
namespace Hip\ExampleBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use Hip\MandrillBundle\Message;
use Hip\MandrillBundle\Dispatcher;
class ExampleController
{
public function indexAction()
{
$dispatcher = $this->get('hip_mandrill.dispatcher');
$message = new Message();
$message
->setFromEmail('[email protected]')
->setFromName('Customer Care')
->addTo('[email protected]')
->setSubject('Some Subject')
->setHtml('<html><body><h1>Some Content</h1></body></html>');
$result = $dispatcher->send($message);
return new Response('<pre>' . print_r($result, true) . '</pre>');
}
}
sh
php ./composer.phar install