mandrill-api 1.0.24 → 1.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/mandrill.rb +3 -0
  2. data/lib/mandrill/api.rb +50 -0
  3. metadata +4 -4
@@ -97,6 +97,9 @@ module Mandrill
97
97
  def messages()
98
98
  Messages.new self
99
99
  end
100
+ def whitelists()
101
+ Whitelists.new self
102
+ end
100
103
  def internal()
101
104
  Internal.new self
102
105
  end
@@ -321,6 +321,16 @@ module Mandrill
321
321
  @master = master
322
322
  end
323
323
 
324
+ # Adds an email to your email rejection blacklist. Addresses that you add manually will never expire and there is no reputation penalty for removing them from your blacklist. Attempting to blacklist an address that has been whitelisted will have no effect.
325
+ # @param [String] email an email address to block
326
+ # @return [Hash] a status object containing the address and the result of the operation
327
+ # - [String] email the email address you provided
328
+ # - [Boolean] added whether the operation succeeded
329
+ def add(email)
330
+ _params = {:email => email}
331
+ return @master.call 'rejects/add', _params
332
+ end
333
+
324
334
  # Retrieves your email rejection blacklist. You can provide an email address to limit the results. Returns up to 1000 results. By default, entries that have expired are excluded from the results; set include_expired to true to include them.
325
335
  # @param [String] email an optional email address to search by
326
336
  # @param [Boolean] include_expired whether to include rejections that have already expired.
@@ -774,6 +784,46 @@ module Mandrill
774
784
  return @master.call 'messages/send-raw', _params
775
785
  end
776
786
 
787
+ end
788
+ class Whitelists
789
+ attr_accessor :master
790
+
791
+ def initialize(master)
792
+ @master = master
793
+ end
794
+
795
+ # Adds an email to your email rejection whitelist. If the address is currently on your blacklist, that blacklist entry will be removed automatically.
796
+ # @param [String] email an email address to add to the whitelist
797
+ # @return [Hash] a status object containing the address and the result of the operation
798
+ # - [String] email the email address you provided
799
+ # - [Boolean] whether the operation succeeded
800
+ def add(email)
801
+ _params = {:email => email}
802
+ return @master.call 'whitelists/add', _params
803
+ end
804
+
805
+ # Retrieves your email rejection whitelist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results.
806
+ # @param [String] email an optional email address or prefix to search by
807
+ # @return [Array] up to 1000 whitelist entries
808
+ # - [Hash] return[] the information for each whitelist entry
809
+ # - [String] email the email that is whitelisted
810
+ # - [String] detail a description of why the email was whitelisted
811
+ # - [String] created_at when the email was added to the whitelist
812
+ def list(email=nil)
813
+ _params = {:email => email}
814
+ return @master.call 'whitelists/list', _params
815
+ end
816
+
817
+ # Removes an email address from the whitelist.
818
+ # @param [String] email the email address to remove from the whitelist
819
+ # @return [Hash] a status object containing the address and whether the deletion succeeded
820
+ # - [String] email the email address that was removed from the blacklist
821
+ # - [Boolean] deleted whether the address was deleted successfully
822
+ def delete(email)
823
+ _params = {:email => email}
824
+ return @master.call 'whitelists/delete', _params
825
+ end
826
+
777
827
  end
778
828
  class Internal
779
829
  attr_accessor :master
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandrill-api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 39
4
+ hash: 37
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 24
10
- version: 1.0.24
9
+ - 25
10
+ version: 1.0.25
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mandrill Devs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-04-19 00:00:00 Z
18
+ date: 2013-04-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json