【问题标题】:Rails ActionMailer include CC field without sending CC emailRails ActionMailer 包含 CC 字段而不发送 CC 电子邮件
【发布时间】:2013-04-26 19:17:29
【问题描述】:

不确定这是否有可能。

我的场景涉及用户提交票证并发送两封电子邮件。

一封电子邮件正在发送给提交者(确认),另一封发送给管理员(已创建工单的警报)。

对于发送给管理员的电子邮件,我想在抄送字段中包含提交者电子邮件,以便他们可以回复所有信息并更新任何信息的提交者。由于已经有一封电子邮件发送给提交者,我当然不希望管理员电子邮件抄送给提交者。

有谁知道 Rails 是否可以在消息的标题中添加 CC 字段而不实际向他们发送电子邮件?

如果有帮助,这是我的newticket.mailer.rb

class NewticketMailer < ActionMailer::Base
  default from: "TicketTracker@example.org"

def email_subjectConf
  "Facilities Ticket Confirmation - Thank you!"
end  

def email_subjectCreation
  "Facilities Ticket created for your location!"
end  

def ticket_confirmation(ticket)
 @ticket = ticket

mail to: @ticket.submitter.full_email, subject: email_subjectConf
end

def ticket_creation(ticket)
 @ticket = ticket

mail to: @ticket.mailing_list.name, subject: email_subjectCreation
end
end

【问题讨论】:

    标签: ruby-on-rails actionmailer


    【解决方案1】:

    您可能应该在管理员消息中使用“回复”标题。

    mail( :to => @ticket.mailing_list.name,
          :subject => email_subjectCreation,
          :reply-to => @ticket.submitter.full_email )
    

    【讨论】:

    • 呃。是的,我想太多了。我觉得非常愚蠢。谢谢
    猜你喜欢
    • 2018-01-22
    • 2019-09-23
    • 2012-07-02
    • 2017-04-30
    • 2014-12-31
    • 2017-01-21
    • 2011-06-15
    • 2017-11-11
    • 2011-08-11
    相关资源
    最近更新 更多