Hi I'm trying to send dynamic data to an external template file using sendgrid like this:
$sendgrid = new SendGrid(getenv('SENDGRID_KEY'));
$email = new SendGrid\Email();
$message_body = file_get_contents('../templates/emails/third-party-booking.php');
$email->addTo(getenv('SENDGRID_EMAIL'))
->setFrom("from@email.com")
->setSubject("Just a subject here")
->setHtml($message_body);
$sendgrid->send($email);
How do I send $details
to the template, thanks!