【问题标题】:Sendgrid Multipart emails Blank from Heroku来自 Heroku 的 Sendgrid Multipart 电子邮件空白
【发布时间】:2012-05-17 20:24:49
【问题描述】:

我只使用在我的 Rails 3.1.4 应用程序中工作的 html 电子邮件,但我决定添加纯文本电子邮件以使其成为多部分,现在电子邮件到达空白。我也开始使用 Sendgrid 的 Heroku 插件 - 不确定这是否是其中的一部分。

当我查看我的 heroku 日志时,我可以看到 .erb 和 .html.erb 这两个视图都成功呈现,并且我没有看到任何错误。电子邮件到达,但 Yahoo! 中的正文是空白的在 Hotmail 中它只说(没有做更多的测试):

This is a multi-part message in MIME format...

----

这是我的邮件:

class Notifier < ActionMailer::Base

  helper :application
  default_url_options[:host] = "foo.com"

  # email on new user registration to verify user
  def verification_instructions(user)
     subject       "Email Verification"
     from          'Bar <info@bar.com>'

     @user = user
     recipients    "#{user.first_name} <#{user.email}>"
     sent_on       Time.now
 @url  = "http://bar.com/user_verifications_controller/show/#{user.perishable_token}"
  end

文本版本(.erb)

Hi <%= @user.username %>, thanks for signing up

Please click the following link to verify your email address:                                           
<%= @url %>

If the above URL does not work, try copying and pasting it into your browser. If you continue to have problems, please feel free to contact us.

I posted the html here.

此外,当我在开发中从控制台发送电子邮件时,我可以查看日志并查看呈现电子邮件的内容。 I put the output here. 尝试了另一封电子邮件,以确保它不是特定于一封电子邮件的问题2

提前感谢您提供的任何帮助。

【问题讨论】:

    标签: ruby-on-rails-3 heroku actionmailer sendgrid


    【解决方案1】:

    我也刚开始使用 Sendgrid....

    我正在使用 sendgrid gem

    我的邮寄者有

    顶部的“包含 SendGrid”

    以及在方法结束时对 mail(subject: "Yadda", to: "recipient@mail.com") 的明确调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-22
      • 1970-01-01
      • 1970-01-01
      • 2017-05-18
      • 1970-01-01
      • 2017-09-01
      • 2016-12-10
      • 2017-03-06
      相关资源
      最近更新 更多