簡體   English   中英

如何使用帶有 php api 的 SendGrid 模板發送電子郵件?

[英]How to send an email using a SendGrid template with php api?

我最近在我的 SendGrid 帳戶中創建了一個模板,我想在我的 php 應用程序中使用它。

我目前正在使用該帳戶發送電子郵件,但我必須在我的應用程序中對 html 進行編碼,這不能提供我需要的靈活性。

我在 API 中找不到一種方法來選擇我想要使用的模板並替換變量....

任何的想法?

謝謝

在深入研究 GitHub 后,我發現這個代碼片段對我有用......我希望它對你有幫助。 要在 v3 中使用模板,代碼如下:

$mail->setTemplateId("xxxxxxxxxxxxxxxxxxxx");
// Put your template ID in from the web console after you create a template

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM