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

Set @html_part / @text_part properly #1681

Merged
merged 1 commit into from May 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions padrino-mailer/lib/padrino-mailer/ext.rb
Expand Up @@ -107,6 +107,7 @@ def part(params = {}, &block)
new_part.instance_eval(&part_block) if part_block
yield new_part if block_given?
add_part(new_part)
new_part
end

def do_delivery_with_logging
Expand Down
3 changes: 3 additions & 0 deletions padrino-mailer/test/test_part.rb
Expand Up @@ -31,6 +31,9 @@
assert_equal 'This is a foo message in mailers/sample dir', message.parts[1].body.decoded.chomp
assert_equal :plain, message.parts[2].content_type
assert_equal 'other', message.parts[2].body.decoded

assert_equal 'This is a foo message in mailers/sample dir', message.html_part.body.decoded.chomp
assert_equal 'plain text', message.text_part.body.decoded
end

it 'should works with multipart templates' do
Expand Down