andrei-mireichyk/sendpulse-mailer

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 3

Type:symfony-bundle

dev-master 2023-02-07 17:16 UTC

This package is not auto-updated.

Last update: 2024-11-13 21:32:46 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);
    }
}