creonit/sendpulse-mailer

Installs: 4 000

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 0

Forks: 3

Open Issues: 0

Type:symfony-bundle

v1.0.0 2020-07-23 11:11 UTC

This package is auto-updated.

Last update: 2024-10-23 20:00:27 UTC


README

SendPulse

Symfony Mailer Documentation

Supported schemes

smtp

MAILER_DSN=sendpulse://USERNAME:PASSWORD@default

smtp api

MAILER_DSN=sendpulse+smtp-api://USER_ID:SECRET@default

Automation360 events

MAILER_DSN=sendpulse+events://USER_ID:SECRET@default
use Creonit\SendPulseMailer\Header\SendPulseVariableHeader;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email;

class MailingController extends AbstractController
{
    public function sendMail(MailerInterface $mailer)
    {
        $to = 'example@example.com';
        $message = new Email();
        $message->to($to);
        $message->getHeaders()
            ->addTextHeader('X-SendPulse-Event', 'event_name')
            ->add(new SendPulseVariableHeader('variable_name', 'value'));
        
        $mailer->send($message);
    }
}