bradpauly / griddler-mailgun

Mailgun adapter for the griddler gem.
MIT License
17 stars 27 forks source link

BCC coming in as params[:recipient] #14

Closed rzane closed 8 years ago

rzane commented 8 years ago

My mailgun route looks like this:

match_recipient("^something")

When I send an email with a BCC of something@mydomain.com, email.bcc will be an empty array. However params[:recipient] will be something@mydomain.com.

I'm curious if there's a decent way to handle this. My current solution involves a monkeypatch:

module NormalizationWithRecipient
  def normalize_params
    super.tap { |result| result[:bcc] << params[:recipient] }
  end
end

Griddler::Mailgun::Adapter.prepend NormalizationWithRecipient
bradpauly commented 8 years ago

Is the BCC info you want available in the headers? Mailgun doesn't send it as a param (except as recipient like you said).

rzane commented 8 years ago

No, it's not available in the headers. Maybe Griddler::Email should have a reader for params. Then, each adapter could return extra params from normalized_params.

This is more of an upstream issue though, so I'm going to close.

bradpauly commented 8 years ago

There has been some discussion about making provider specific params available via Griddler::Email. I think it has been targeted for v2.

rzane commented 8 years ago

👍