0
私はSendGrid PHP APIを使用してニュースレターを送信していますが、テンプレートIDを使用すると、送信されたメールにはCSS &イメージが含まれません。SendGrid電子メールテンプレートスタイルは適用されません
は、ここに私のコードです:
<?php
require("sendgrid-php/sendgrid-php.php");
$from = new SendGrid\Email(null, "[email protected]");
$subject = "Hello World from the SendGrid PHP Library!";
$to = new SendGrid\Email(null, "[email protected]");
$content = new SendGrid\Content("text/plain", "hello");
$mail = new SendGrid\Mail($from, $subject, $to, $content);
$mail->setTemplateId("727274bc-XXXX-XXXX-XXXX-83a2b53597e5");
$apiKey = 'SG.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$sg = new \SendGrid($apiKey);
$response = $sg->client->mail()->send()->post($mail);
echo $response->statusCode();
echo $response->headers();
echo $response->body();
?>
ホープ誰かが私に おかげで解決