【发布时间】:2011-11-05 11:58:02
【问题描述】:
我在 heroku 中托管了一个 Rails 3.0.5 应用程序。要发送电子邮件,我使用 Sendgrid。我在免费计划中,但它每天有 200 封电子邮件的限制。我想知道 Rails 或这个插件“Sendgrid”中是否有办法查看今天发送了多少封电子邮件。
【问题讨论】:
标签: ruby-on-rails-3 heroku sendgrid
我在 heroku 中托管了一个 Rails 3.0.5 应用程序。要发送电子邮件,我使用 Sendgrid。我在免费计划中,但它每天有 200 封电子邮件的限制。我想知道 Rails 或这个插件“Sendgrid”中是否有办法查看今天发送了多少封电子邮件。
【问题讨论】:
标签: ruby-on-rails-3 heroku sendgrid
【讨论】:
看看 SendGrid API..
REST GET 请求:
https://sendgrid.com/apiv2/reseller.account.json?api_user=username&api_key=secureSecret&task=overview&user=customer@example.com
将返回类似:
<result> <overview> <reputation>100</reputation> <requests>50000</requests> <package>Silver Package</package> <credits_allowed>50000</credits_allowed> <credits_used>100000</credits_used> <credits_remain>0</credits_remain> <credits_overage>50000</credits_overage> <billing_start_date>2010-08-30</billing_start_date> <billing_end_date>2010-09-29</billing_end_date> <billing_process_date>2010-09-30</billing_process_date> </overview> </result>
(因链接错误的 API 页面而编辑)。
【讨论】:
我发现最简单的方法是在 Heroku 上的应用中单击 SendGrid 插件。主屏幕将告诉您今天发送了多少封电子邮件。如果您点击“电子邮件活动”选项卡,您可以看到所有已发送的电子邮件。
【讨论】: