1
내 index.php에 SendGrid X-SMTPAPI 헤더를 작성하여 sendgrid 템플릿을 적용하려고합니다. 템플릿 엔진 템플릿을 사용하려면 템플릿 활성화템플릿 적용을위한 SendGrid SMTP API
"다음 SendGrid 문서에서 복사로,
// Start Sendgrid
$sendgrid = new SendGrid('userid', 'pwd');
$header = new Smtpapi\Header();
$filter = array(
'templates' => array(
'settings' => array(
'enabled' => 1,
'template_id' => 'f2c99ace-87af-2618-8390-c19e2ad2805f'
)
)
);
$header->setFilters($filter);
$emailwelcome = new SendGrid\Email();
$emailwelcome->addTo($email)->
setFrom('[email protected]')->
setFromName('Welcome to World')->
setSubject('Your Invitation')->
setText('Hello World!')->
setHtml('<strong>Hello World!</strong>');
$sendgrid->send($emailwelcome);
템플릿을 적용하려면 :
이
내 index.php를 코드의 추상입니다 전송할 때 템플릿 필터를 활성화하고 template_id를 템플릿 엔진 템플릿 중 하나로 설정하십시오.예
{
"filters": {
"templates": {
"settings": {
"enable": 1,
"template_id": "5997fcf6-2b9f-484d-acd5-7e9a99f0dc1f"
}
}
}
}
이 JSON은 SMTP 메시지의 X-SMTPAPI 헤더 나 mail.send API 호출의 x-smtpapi 매개 변수에서 사용할 수 있습니다.
질문 : 내 SMTP 메시지의 X-SMTPAPI 헤더는 어디에 있습니까? 내 composer.json 또는 index.php 또는 공급 업체 파일에 있습니까?
도움 주셔서 감사합니다.
: 당신이 할 필요가 index.php에 코드의 이러한 두 줄을 추가입니다 .com 또는 customer.io. 유스 케이스에 따라 체크 아웃 할 가치가 있습니다. – bvanvugt