Skip to content

Commit

Permalink
Merge pull request #21 from ananichev/add-tags-key
Browse files Browse the repository at this point in the history
Add ability to set :tags key.
  • Loading branch information
demoore committed May 30, 2015
2 parents eb72d4e + c785b44 commit 818c03d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class Notifier < SendWithUsMailer::Base
version_name: 'version-A',
locale: 'en-US',
files: ["/path/to/file"],
headers: { 'header-name' => 'header-value' }
headers: { 'header-name' => 'header-value' },
tags: ['some-tag']
)
end
end
Expand Down
6 changes: 5 additions & 1 deletion lib/sendwithus_ruby_action_mailer/mail_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def initialize #:nodoc:
@locale = ""
@files = []
@headers = {}
@tags = []
end

def assign(key, value) #:nodoc:
Expand Down Expand Up @@ -47,6 +48,8 @@ def merge!(params={}) #:nodoc:
@files.concat(value)
when :headers
@headers.merge!(value)
when :tags
@tags.concat(value)
end
end
end
Expand All @@ -69,7 +72,8 @@ def deliver
version_name: @version_name,
locale: @locale,
files: @files,
headers: @headers
headers: @headers,
tags: @tags
)
end
end
Expand Down
3 changes: 2 additions & 1 deletion test/lib/sendwithus_ruby_action_mailer/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def example_email
from_name: 'asender',
reply_to: '[email protected]',
version_name: 'v2',
headers: { 'header-name' => 'header-value' }
headers: { 'header-name' => 'header-value' },
tags: ['some-tag']
end
end

Expand Down

0 comments on commit 818c03d

Please sign in to comment.