Php 使用Sendgrid Web API每周发送新闻稿

Php 使用Sendgrid Web API每周发送新闻稿,php,sendgrid,Php,Sendgrid,我正在使用PHP开发一个项目,其中我正在使用sendgrid web API。其中,我希望在用户指定的日期每周或每月发送新闻稿 我不知道如何在sendgrid上管理它。 任何人都可以帮助我并给我解决方案。从这里下载Sendgrid PHP包装器: 包括“path/to/sendgrid php/sendgrid_loader.php”; //使用SendGrid凭据初始化SendGrid对象: $sendgrid=newsendgrid('username','password'); //创建

我正在使用PHP开发一个项目,其中我正在使用sendgrid web API。其中,我希望在用户指定的日期每周或每月发送新闻稿

我不知道如何在sendgrid上管理它。
任何人都可以帮助我并给我解决方案。

从这里下载Sendgrid PHP包装器:

包括“path/to/sendgrid php/sendgrid_loader.php”; //使用SendGrid凭据初始化SendGrid对象: $sendgrid=newsendgrid('username','password'); //创建新的SendGrid邮件对象并添加邮件详细信息 $mail=new SendGrid\mail(); $mail-> 地址('foo@bar.com')-> 设置自('me@bar.com')-> setSubject('主题在这里')-> setText(“你好,世界!”)-> setHtml(“你好,世界!”); //使用Web API发送,如下所示: $sendgrid-> 网络-> 发送($邮件); 请在此处查看Sendgrid API文档

编辑:


在服务器上设置cron作业以每周或每月运行此脚本。

从此处下载Sendgrid PHP包装器:

包括“path/to/sendgrid php/sendgrid_loader.php”; //使用SendGrid凭据初始化SendGrid对象: $sendgrid=newsendgrid('username','password'); //创建新的SendGrid邮件对象并添加邮件详细信息 $mail=new SendGrid\mail(); $mail-> 地址('foo@bar.com')-> 设置自('me@bar.com')-> setSubject('主题在这里')-> setText(“你好,世界!”)-> setHtml(“你好,世界!”); //使用Web API发送,如下所示: $sendgrid-> 网络-> 发送($邮件); 请在此处查看Sendgrid API文档

编辑:


在服务器上安装cron作业以每周或每月运行此脚本。

Sendgrid不提供任何此类服务


如果您希望处理定期发送的新闻稿,则可以通过管理数据库和服务器上的cron作业来管理。

Sendgrid不提供任何此类服务


如果您希望处理定期发送的新闻稿,则可以通过管理数据库和服务器上的cron作业进行管理。

您正在查找新闻稿API,该API记录在此处:

具体而言,您可以使用API使用schedule endpoint计划交付:


没有PHP包装器,因此您需要使用curl或类似的东西发出请求。

您正在寻找时事通讯API,这里有文档记录:

具体而言,您可以使用API使用schedule endpoint计划交付:


没有PHP包装器,因此您需要使用curl或类似的东西发出请求。

不知道snedgrid,但调度可以通过cron作业完成我知道我可以通过cron作业完成,但我想知道sendgrid是否提供了任何工具?不知道snedgrid,但是调度可以用cron作业来完成我知道我可以用cron作业来完成,但是我想知道sendgrid是否为此提供了任何工具?我知道我可以用cron作业来完成,但是我想在sendgrid handels中找到一种方法我知道我可以用cron作业来完成,但是我想在sendgrid handels中找到一种方法我正在寻找的所有东西对于递归计划,我可以使用它在每个月的特定日期和时间向列表发送时事通讯。我发现send grid没有提供任何功能。我正在寻找一个递归的时间表,使用它我可以在每个月的特定日期和时间将时事通讯发送到列表中。我发现send grid没有提供任何功能。 include 'path/to/sendgrid-php/SendGrid_loader.php'; //Initialize the SendGrid object with your SendGrid credentials: $sendgrid = new SendGrid('username', 'password'); //Create a new SendGrid Mail object and add your message details $mail = new SendGrid\Mail(); $mail-> addTo('foo@bar.com')-> setFrom('me@bar.com')-> setSubject('Subject goes here')-> setText('Hello World!')-> setHtml('Hello World!'); //Send it using the Web API like so: $sendgrid-> web-> send($mail);