如何使用rails发送'Mark as Important'邮件

Sal*_*lil 2 ruby email-integration ruby-on-rails html-email

我需要你的意见,因为我不知道是否可能.

我希望我的应用程序发送一些电子邮件,'Mark as Important'以便当最终用户收到此邮件时,Evolution/Outlook他们应该知道电子邮件的重要性.

目前,当我使用evolution标记任何电子邮件时,'Mark as Important'它会将邮件主题和其他字段的颜色更改为red.

Rom*_*man 8

其他两个答案都是正确的,但问题是,Outlook使用非标准标头来表示信号重要性.它被称为X-Priority,因此您必须将其包含在外发邮件中.您还可以为旧版Outlook添加"X-MSMail-Priority:High".


def notification
  mail({
      :to => 'email@example.com',
      :subject => 'My subject',
      :from => 'me@somewhere.com',
      'Importance' => 'high',
      'X-Priority' => '1'}) do |format|
    format.text
    format.html
  end
end
Run Code Online (Sandbox Code Playgroud)


ste*_*lag 6

class Notifier < ActionMailer::Base
  default :from => 'no-reply@example.com',
          :return_path => 'system@example.com'

  def welcome(recipient)
    @account = recipient
    mail(:to => recipient.email_address_with_name,
         :bcc => ["bcc@example.com", "Order Watcher <watcher@example.com>"],
         :subject => "No way!",
         :importance => "High") # <======
    end
  end
Run Code Online (Sandbox Code Playgroud)