使用API​​方法而不是SMTP的Rails ActionMailer-SendGrid

我正在尝试使用Rails 5.2和Sendgrid发送邮件。我已经阅读了如何设置它的教程。但是,我发现的所有方法都是设置SMTP发送方法的方法,该方法比API方法要慢。示例:https://medium.com/le-wagon/how-to-send-email-with-action-mailer-and-sendgrid-in-rails-5-32ed0c9167fd

使用标准的sendgrid gem:https://github.com/sendgrid/sendgrid-ruby

是否仍然可以使用操作邮件程序和API方法发送电子邮件?我不想只使用api密钥进行身份验证,我想使用api而不是SMTP发送邮件。

niaoren123456ZJJ1988 回答:使用API​​方法而不是SMTP的Rails ActionMailer-SendGrid

未使用标准的sendgrid gem,但确实看到了此gem:

https://github.com/eddiezane/sendgrid-actionmailer

通过将以下内容添加到a.flatMap(aa => tickets.flatMap(t => insuranceRateQuote(aa,t))) 中,允许动作邮件程序使用api方法:

config/environments/production.rb
本文链接:https://www.f2er.com/2856329.html

大家都在问