I wanted to convert the below code to symphony mailer using symphony mailer Transport. But I can’t add the existing templete in symphony mailer without using twig concept.
Existing Code:
$data = array(.....);
$subject = "Test Email";
Mail::send('mail.invitation', $data, function($message)
{
$message
->to($this->toEmail)
->from($this->fromEmail)
->subject($subject);
});
Similarly:
$transport = Transport::fromDsn(env('MAILER_DSN'));
$mailer = new Mailer($transport);
$data = array(.....);
$subject = "Test Email";
$email = (new Email())
->from($this->fromEmail)
->to($this->toEmail)
->priority(Email::PRIORITY_HIGH)
->subject($subject)
->text('Sending emails')
->html('mail.invitation', $data);
$mailer->send($email);
Please help me and thanks in advance.