Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCC #54

Open
Tensho opened this issue Mar 13, 2017 · 3 comments
Open

BCC #54

Tensho opened this issue Mar 13, 2017 · 3 comments

Comments

@Tensho
Copy link
Contributor

Tensho commented Mar 13, 2017

I was surprised, that MandrillDm::Message doesn't have #bcc method. After digging some code I noticed, that we accumulate to, cc and bcc inside #combine_address_fields and handle BCC this way. But I can't understand, what is the difference between classic bcc field and custom Mandrillbcc_address parameter?
Example:

class AlphabetMailer < ActionMailer::Base
  def a
    mail(from: 'anything@example.com',
         to: 'a.babichev@example.com',
         bcc: 'andrew.babichev@gmail.com',
         subject: 'Alpha',
         body: '',
         delivery_method: :mandrill)
  end

  def b
    mail(from: 'anything@example.com',
         to: 'a.babichev@example.com',
         bcc_address: 'andrew.babichev@gmail.com',
         subject: 'Beta',
         body: '',
         delivery_method: :mandrill)
  end
end

# AlphabetMailer.a.deliver_now and AlphabetMailer.b.deliver_now work the same as expected.
@Tensho
Copy link
Contributor Author

Tensho commented Mar 17, 2017

Guys, I'm afraid my question is not relevant and I should dig somewhere else, so please can you share your thoughts?

@AnkurVyas-BTC
Copy link
Contributor

AnkurVyas-BTC commented May 12, 2017

@Tensho - I also tried to use the bcc method but it was not picking up the merge vars which I passed in the with the rcpt parameter.

bcc_address: an optional address to receive an exact copy of each recipient's email (Ref: https://mandrillapp.com/api/docs/messages.html )

I was saved by bcc address parameter. It sends the exact copy of the recipient's email. If you want to send bcc email with this gem please use the bcc_address parameter.

@Tensho
Copy link
Contributor Author

Tensho commented May 15, 2017

I guess to be consolidated with ActioMailer API mandrill_dm should expose #bcc method and use #bcc_address method/parameter under the hood. This allows just to switch delivery method in ActionMailer::Base#mail call without the need to have the conditional clause for BCC option. Does it make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants