Skip to content

Header handling doesn't match Mail gem's delivery methods #80

Description

@cgriego

When using any of the built-in Mail delivery methods, this works as expected to send a custom header.

class FooMailer < ApplicationMailer
  def foo_message
    headers['X-CUSTOM'] = "I am some header"
    mail(
      :from         => "example@example.com",
      :to           => "example@example.com",
      :subject      => "My Test message"
    ) do |format|
      format.text { "I am a message. Wheeeeeee" }
    end
  end
end

This also works.

class FooMailer < ApplicationMailer
  def foo_message
    mail(
      :from         => "example@example.com",
      :to           => "example@example.com",
      :subject      => "My Test message",
      "X-CUSTOM"    => "I am some header"
    ) do |format|
      format.text { "I am a message. Wheeeeeee" }
    end
  end
end

This gem is instead requiring this:

class FooMailer < ApplicationMailer
  def foo_message
    mail(
      :from         => "example@example.com",
      :to           => "example@example.com",
      :subject      => "My Test message",
      :headers      => {
        "X-CUSTOM"     => "I am some header"
      }
    ) do |format|
      format.text { "I am a message. Wheeeeeee" }
    end
  end
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions