1. Go to this page and download the library: Download sendery/symfony 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/ */
sendery / symfony example snippets
use Sendery\Symfony\TemplateEmail;
use Symfony\Component\Mailer\MailerInterface;
final class TemplateEmails
{
public function __construct(private MailerInterface $mailer) {}
public function send(string $address, string $template, array $data): void
{
$email = (new TemplateEmail())
->from('[email protected]')
->to($address)
->template($template, $data);
$this->mailer->send($email);
}
}