邮戳出站电子邮件Rails 3

时间:2014-07-25 03:54:22

标签: ruby-on-rails-3 email-integration inbound postmark

我正在练习婚礼现场。不幸的是,我无法将我的电子邮件发送给已经回复的客人。我不确定应该遵循什么:to =>

  

Rsvp_Mailer.rb

class RsvpMailer < ActionMailer::Base

  def rsvp_email(primary, guests, message)
    @primary = primary
    @guests  = guests
    @message = message

    subject_prefix = primary.attending? ? "Attending" : "Not Attending"

    mail(:from => '"www.personaldomain.com" <no-reply@personaldomain.com>', :to => '???' :subject => "New RSVP - #{subject_prefix} : #{primary.first_name} #{primary.last_name} + #{@guests.size}")
  end
end

1 个答案:

答案 0 :(得分:0)

您需要将收件人的电子邮件地址传递给:to,如下所示:

mail(:from => '"www.personaldomain.com" <no-reply@personaldomain.com>', :to => 'user@example.com' :subject => "New RSVP - #{subject_prefix} : #{primary.first_name} #{primary.last_name} + #{@guests.size}")

这意味着您必须为需要获取该消息的每个用户调用RsvpMailer.rsvp_email.deliver。