Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add reply-to to letter opener output #24

Closed
wants to merge 1 commit into from

4 participants

@bjhess

With a test!

(Love letter_opener, btw!)

!

~Barry

@tvdeyen

+1

@daeltar

+1

@nashby
Collaborator

@bjhess hi, could you please rebase it? It can't be automatically merged :(

@nashby
Collaborator

@bjhess nevermind. Looks like this feature was added already. Thanks for the pull request though!

@nashby nashby closed this
@bjhess

Glad the feature finally made it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 21, 2011
  1. @bjhess
This page is out of date. Refresh to see the latest.
View
5 lib/letter_opener/message.html.erb
@@ -59,6 +59,11 @@
<dl>
<dt>From:</dt>
<dd><%= from %></dd>
+
+ <% if reply_to %>
+ <dt>Reply to:</dt>
+ <dd><%= reply_to %></dd>
+ <% end %>
<dt>Subject:</dt>
<dd><strong><%= mail.subject %></strong></dd>
View
4 lib/letter_opener/message.rb
@@ -35,6 +35,10 @@ def from
@from ||= @mail.from.kind_of?(Array) && @mail.from.join(", ") || @mail.from
end
+ def reply_to
+ @reply_to ||= @mail.reply_to.kind_of?(Array) && @mail.reply_to.join(", ") || @mail.reply_to
+ end
+
def type
content_type =~ /html/ ? "rich" : "plain"
end
View
10 spec/letter_opener/delivery_method_spec.rb
@@ -14,13 +14,15 @@
it "saves text into html document" do
Launchy.should_receive(:open)
mail = Mail.deliver do
- from 'Foo foo@example.com'
- to 'bar@example.com'
- subject 'Hello'
- body 'World!'
+ from 'Foo foo@example.com'
+ reply_to 'baz@example.com'
+ to 'bar@example.com'
+ subject 'Hello'
+ body 'World!'
end
text = File.read(Dir["#{@location}/*/plain.html"].first)
text.should include("Foo foo@example.com")
+ text.should include("baz@example.com")
text.should include("bar@example.com")
text.should include("Hello")
text.should include("World!")
Something went wrong with that request. Please try again.