-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,20 @@ Then | |
# ... | ||
end | ||
|
||
# tagging message for tracking delivery | ||
|
||
class TestMailer < ActionMailer::Base | ||
def tagged_message | ||
subject 'hello' | ||
recipients '[email protected]' | ||
from '[email protected]' | ||
tag 'delivery' # Tag should be a single string | ||
end | ||
end | ||
|
||
== Limitations | ||
Currently postmark API does not support multiple recipients, or attachments. For more information, check the docs here: | ||
TODO: URL to docs. | ||
Currently postmark API does not support attachments. For more information, check the docs here: | ||
http://developer.postmarkapp.com | ||
|
||
== Requirements | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,11 @@ def multipart_message | |
from '[email protected]' | ||
end | ||
|
||
def tagged_message | ||
subject 'hello' | ||
recipients '[email protected]' | ||
from '[email protected]' | ||
tag 'delivery' | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') | ||
|
||
describe "PostmarkRails" do | ||
|
||
it "should use postmark for delivery" do | ||
Postmark.should_receive(:send_through_postmark) do |message| | ||
message.subject.should == "hello" | ||
end | ||
TestMailer.deliver_simple_message | ||
end | ||
|
||
it "should allow tagging of message" do | ||
Postmark.should_receive(:send_through_postmark) do |message| | ||
message.tag.to_s.should == "delivery" | ||
end | ||
TestMailer.deliver_tagged_message | ||
end | ||
|
||
end |