mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #36523 from y-yagi/include_bcc_in_mail_sent_from_development_page
Include BCC in the mail that sent from the development page
This commit is contained in:
commit
defd6c411e
2 changed files with 3 additions and 0 deletions
|
@ -21,6 +21,7 @@ module Rails
|
|||
private
|
||||
def new_mail
|
||||
Mail.new(params.require(:mail).permit(:from, :to, :cc, :bcc, :in_reply_to, :subject, :body).to_h).tap do |mail|
|
||||
mail[:bcc]&.include_in_headers = true
|
||||
params[:mail][:attachments].to_a.each do |attachment|
|
||||
mail.add_file(filename: attachment.path, content: attachment.read)
|
||||
end
|
||||
|
|
|
@ -10,6 +10,7 @@ class Rails::Conductor::ActionMailbox::InboundEmailsControllerTest < ActionDispa
|
|||
mail: {
|
||||
from: "Jason Fried <jason@37signals.com>",
|
||||
to: "Replies <replies@example.com>",
|
||||
bcc: "Bcc <bcc@example.com>",
|
||||
in_reply_to: "<4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>",
|
||||
subject: "Hey there",
|
||||
body: "How's it going?"
|
||||
|
@ -20,6 +21,7 @@ class Rails::Conductor::ActionMailbox::InboundEmailsControllerTest < ActionDispa
|
|||
mail = ActionMailbox::InboundEmail.last.mail
|
||||
assert_equal %w[ jason@37signals.com ], mail.from
|
||||
assert_equal %w[ replies@example.com ], mail.to
|
||||
assert_equal %w[ bcc@example.com ], mail.bcc
|
||||
assert_equal "4e6e35f5a38b4_479f13bb90078178@small-app-01.mail", mail.in_reply_to
|
||||
assert_equal "Hey there", mail.subject
|
||||
assert_equal "How's it going?", mail.body.decoded
|
||||
|
|
Loading…
Reference in a new issue