J'utilise dompdf pour genearate un pdf (sortie $ = $ dompdf-> sortie();) et je dois attacher à phpmailer et le poster ....Comment attacher un pdf généré par dompdf dans le courrier en utilisant sendgrid mail api?
Et j'utilise comme SendGrid services de courrier ...
function sendEMailwithAttachment($mail_type, $mail_variable = array(), $subject, $from, $mailto, $username, $fileName, $filePath) {
$to = new SendGrid\Email($username, $mailto);
$content = new SendGrid\Content("text/html", $message);
$file = $filePath;
$file_encoded = base64_encode(file_get_contents($file));
$attachment = new SendGrid\Attachment();
$attachment->setContent($file_encoded);
$attachment->setType("application/text");
$attachment->setDisposition("attachment");
$attachment->setFilename($fileName);
$mail = new SendGrid\Mail($from, $subject, $to, $content);
$mail->addAttachment($attachment);
}
Comment puis-je passer $ la valeur de sortie email
Est une façon de passer $ sortie comme $ filePath?