mandrill-api 1.0.49 → 1.0.55

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7ba5d218cdae924880eabda68b5168694cb51d4231a435f3c27d798a825a2fd1
4
+ data.tar.gz: 88f79993a7ac30a36beb6d73fc8a22e1cd61db2e88cbeab663cbb3b165f627e8
5
+ SHA512:
6
+ metadata.gz: 56e9f88f4192ca42d5a900eaf558487708e564109dd31603d86550188e9ebe936501c32d515c5936eb448b0fb80c263e69af0ccbfa5b72e64a2d0e594bbcb3dc
7
+ data.tar.gz: 686d3f646ece2704e864b8994e179b0e39d04b56e8f6d878de3b56a54a7556ce9bd59e7d28d39d85133251fc74c1dda6bba402c95ef40e1a65988242c07c7433
data/lib/mandrill.rb CHANGED
@@ -71,10 +71,16 @@ module Mandrill
71
71
  'Unknown_Export' => UnknownExportError,
72
72
  'IP_ProvisionLimit' => IPProvisionLimitError,
73
73
  'Unknown_Pool' => UnknownPoolError,
74
+ 'NoSendingHistory' => NoSendingHistoryError,
75
+ 'PoorReputation' => PoorReputationError,
74
76
  'Unknown_IP' => UnknownIPError,
75
77
  'Invalid_EmptyDefaultPool' => InvalidEmptyDefaultPoolError,
76
78
  'Invalid_DeleteDefaultPool' => InvalidDeleteDefaultPoolError,
77
- 'Invalid_DeleteNonEmptyPool' => InvalidDeleteNonEmptyPoolError
79
+ 'Invalid_DeleteNonEmptyPool' => InvalidDeleteNonEmptyPoolError,
80
+ 'Invalid_CustomDNS' => InvalidCustomDNSError,
81
+ 'Invalid_CustomDNSPending' => InvalidCustomDNSPendingError,
82
+ 'Metadata_FieldLimit' => MetadataFieldLimitError,
83
+ 'Unknown_MetadataField' => UnknownMetadataFieldError
78
84
  }
79
85
 
80
86
  begin
@@ -134,6 +140,9 @@ module Mandrill
134
140
  def senders()
135
141
  Senders.new self
136
142
  end
143
+ def metadata()
144
+ Metadata.new self
145
+ end
137
146
  end
138
147
  end
139
148
 
data/lib/mandrill/api.rb CHANGED
@@ -447,7 +447,7 @@ module Mandrill
447
447
  # @return [Array] Up to 1000 rejection entries
448
448
  # - [Hash] return[] the information for each rejection blacklist entry
449
449
  # - [String] email the email that is blocked
450
- # - [String] reason the type of event (hard-bounce, soft-bounce, spam, unsub) that caused this rejection
450
+ # - [String] reason the type of event (hard-bounce, soft-bounce, spam, unsub, custom) that caused this rejection
451
451
  # - [String] detail extended details about the event, such as the SMTP diagnostic for bounces or the comment for manually-created rejections
452
452
  # - [String] created_at when the email was added to the blacklist
453
453
  # - [String] last_event_at the timestamp of the most recent event that either created or renewed this rejection
@@ -797,17 +797,18 @@ module Mandrill
797
797
  # - [String] signing_domain a custom domain to use for SPF/DKIM signing instead of mandrill (for "via" or "on behalf of" in email clients)
798
798
  # - [String] return_path_domain a custom domain to use for the messages's return-path
799
799
  # - [Boolean] merge whether to evaluate merge tags in the message. Will automatically be set to true if either merge_vars or global_merge_vars are provided.
800
+ # - [String] merge_language the merge tag language to use when evaluating merge tags, either mailchimp or handlebars
800
801
  # - [Array] global_merge_vars global merge variables to use for all recipients. You can override these per recipient.
801
802
  # - [Hash] global_merge_vars[] a single global merge variable
802
803
  # - [String] name the global merge variable's name. Merge variable names are case-insensitive and may not start with _
803
- # - [String] content the global merge variable's content
804
+ # - [Mixed] content the global merge variable's content
804
805
  # - [Array] merge_vars per-recipient merge variables, which override global merge variables with the same name.
805
806
  # - [Hash] merge_vars[] per-recipient merge variables
806
807
  # - [String] rcpt the email address of the recipient that the merge variables should apply to
807
808
  # - [Array] vars the recipient's merge variables
808
809
  # - [Hash] vars[] a single merge variable
809
810
  # - [String] name the merge variable's name. Merge variable names are case-insensitive and may not start with _
810
- # - [String] content the merge variable's content
811
+ # - [Mixed] content the merge variable's content
811
812
  # - [Array] tags an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will cause errors.
812
813
  # - [String] tags[] a single tag - must not start with an underscore
813
814
  # - [String] subaccount the unique id of a subaccount for this message - must already exist or will fail with an error
@@ -831,11 +832,11 @@ module Mandrill
831
832
  # @param [Boolean] async enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
832
833
  # @param [String] ip_pool the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
833
834
  # @param [String] send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately. An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.
834
- # @return [Array] of structs for each recipient containing the key "email" with the email address and "status" as either "sent", "queued", or "rejected"
835
+ # @return [Array] of structs for each recipient containing the key "email" with the email address, and details of the message status for that recipient
835
836
  # - [Hash] return[] the sending results for a single recipient
836
837
  # - [String] email the email address of the recipient
837
838
  # - [String] status the sending status of the recipient - either "sent", "queued", "scheduled", "rejected", or "invalid"
838
- # - [String] reject_reason the reason for the rejection if the recipient status is "rejected"
839
+ # - [String] reject_reason the reason for the rejection if the recipient status is "rejected" - one of "hard-bounce", "soft-bounce", "spam", "unsub", "custom", "invalid-sender", "invalid", "test-mode-limit", or "rule"
839
840
  # - [String] _id the message's unique id
840
841
  def send(message, async=false, ip_pool=nil, send_at=nil)
841
842
  _params = {:message => message, :async => async, :ip_pool => ip_pool, :send_at => send_at}
@@ -874,17 +875,18 @@ module Mandrill
874
875
  # - [String] signing_domain a custom domain to use for SPF/DKIM signing instead of mandrill (for "via" or "on behalf of" in email clients)
875
876
  # - [String] return_path_domain a custom domain to use for the messages's return-path
876
877
  # - [Boolean] merge whether to evaluate merge tags in the message. Will automatically be set to true if either merge_vars or global_merge_vars are provided.
878
+ # - [String] merge_language the merge tag language to use when evaluating merge tags, either mailchimp or handlebars
877
879
  # - [Array] global_merge_vars global merge variables to use for all recipients. You can override these per recipient.
878
880
  # - [Hash] global_merge_vars[] a single global merge variable
879
881
  # - [String] name the global merge variable's name. Merge variable names are case-insensitive and may not start with _
880
- # - [String] content the global merge variable's content
882
+ # - [Mixed] content the global merge variable's content
881
883
  # - [Array] merge_vars per-recipient merge variables, which override global merge variables with the same name.
882
884
  # - [Hash] merge_vars[] per-recipient merge variables
883
885
  # - [String] rcpt the email address of the recipient that the merge variables should apply to
884
886
  # - [Array] vars the recipient's merge variables
885
887
  # - [Hash] vars[] a single merge variable
886
888
  # - [String] name the merge variable's name. Merge variable names are case-insensitive and may not start with _
887
- # - [String] content the merge variable's content
889
+ # - [Mixed] content the merge variable's content
888
890
  # - [Array] tags an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will cause errors.
889
891
  # - [String] tags[] a single tag - must not start with an underscore
890
892
  # - [String] subaccount the unique id of a subaccount for this message - must already exist or will fail with an error
@@ -908,19 +910,19 @@ module Mandrill
908
910
  # @param [Boolean] async enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
909
911
  # @param [String] ip_pool the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
910
912
  # @param [String] send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately. An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.
911
- # @return [Array] of structs for each recipient containing the key "email" with the email address and "status" as either "sent", "queued", "scheduled", or "rejected"
913
+ # @return [Array] of structs for each recipient containing the key "email" with the email address, and details of the message status for that recipient
912
914
  # - [Hash] return[] the sending results for a single recipient
913
915
  # - [String] email the email address of the recipient
914
916
  # - [String] status the sending status of the recipient - either "sent", "queued", "rejected", or "invalid"
915
- # - [String] reject_reason the reason for the rejection if the recipient status is "rejected"
917
+ # - [String] reject_reason the reason for the rejection if the recipient status is "rejected" - one of "hard-bounce", "soft-bounce", "spam", "unsub", "custom", "invalid-sender", "invalid", "test-mode-limit", or "rule"
916
918
  # - [String] _id the message's unique id
917
919
  def send_template(template_name, template_content, message, async=false, ip_pool=nil, send_at=nil)
918
920
  _params = {:template_name => template_name, :template_content => template_content, :message => message, :async => async, :ip_pool => ip_pool, :send_at => send_at}
919
921
  return @master.call 'messages/send-template', _params
920
922
  end
921
923
 
922
- # Search the content of recently sent messages and optionally narrow by date range, tags and senders
923
- # @param [String] query the search terms to find matching messages for
924
+ # Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. If no date range is specified, results within the last 7 days are returned. This method may be called up to 20 times per minute. If you need the data more often, you can use <a href="/api/docs/messages.html#method=info">/messages/info.json</a> to get the information for a single message, or <a href="http://help.mandrill.com/entries/21738186-Introduction-to-Webhooks">webhooks</a> to push activity to your own application for querying.
925
+ # @param [String] query <a href="http://help.mandrill.com/entries/22211902">search terms</a> to find matching messages
924
926
  # @param [String] date_from start date
925
927
  # @param [String] date_to end date
926
928
  # @param [Array] tags an array of tag names to narrow the search to, will return messages that contain ANY of the tags
@@ -1091,18 +1093,18 @@ module Mandrill
1091
1093
  # @param [String] ip_pool the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
1092
1094
  # @param [String] send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately.
1093
1095
  # @param [String] return_path_domain a custom domain to use for the messages's return-path
1094
- # @return [Array] of structs for each recipient containing the key "email" with the email address and "status" as either "sent", "queued", or "rejected"
1096
+ # @return [Array] of structs for each recipient containing the key "email" with the email address, and details of the message status for that recipient
1095
1097
  # - [Hash] return[] the sending results for a single recipient
1096
1098
  # - [String] email the email address of the recipient
1097
1099
  # - [String] status the sending status of the recipient - either "sent", "queued", "scheduled", "rejected", or "invalid"
1098
- # - [String] reject_reason the reason for the rejection if the recipient status is "rejected"
1100
+ # - [String] reject_reason the reason for the rejection if the recipient status is "rejected" - one of "hard-bounce", "soft-bounce", "spam", "unsub", "custom", "invalid-sender", "invalid", "test-mode-limit", or "rule"
1099
1101
  # - [String] _id the message's unique id
1100
1102
  def send_raw(raw_message, from_email=nil, from_name=nil, to=nil, async=false, ip_pool=nil, send_at=nil, return_path_domain=nil)
1101
1103
  _params = {:raw_message => raw_message, :from_email => from_email, :from_name => from_name, :to => to, :async => async, :ip_pool => ip_pool, :send_at => send_at, :return_path_domain => return_path_domain}
1102
1104
  return @master.call 'messages/send-raw', _params
1103
1105
  end
1104
1106
 
1105
- # Queries your scheduled emails by sender or recipient, or both.
1107
+ # Queries your scheduled emails.
1106
1108
  # @param [String] to an optional recipient address to restrict results to
1107
1109
  # @return [Array] a list of up to 1000 scheduled emails
1108
1110
  # - [Hash] return[] a scheduled email
@@ -1156,11 +1158,12 @@ module Mandrill
1156
1158
 
1157
1159
  # Adds an email to your email rejection whitelist. If the address is currently on your blacklist, that blacklist entry will be removed automatically.
1158
1160
  # @param [String] email an email address to add to the whitelist
1161
+ # @param [String] comment an optional description of why the email was whitelisted
1159
1162
  # @return [Hash] a status object containing the address and the result of the operation
1160
1163
  # - [String] email the email address you provided
1161
- # - [Boolean] whether the operation succeeded
1162
- def add(email)
1163
- _params = {:email => email}
1164
+ # - [Boolean] added whether the operation succeeded
1165
+ def add(email, comment=nil)
1166
+ _params = {:email => email, :comment => comment}
1164
1167
  return @master.call 'whitelists/add', _params
1165
1168
  end
1166
1169
 
@@ -1888,7 +1891,7 @@ module Mandrill
1888
1891
  return @master.call 'senders/check-domain', _params
1889
1892
  end
1890
1893
 
1891
- # Sends a verification email in order to verify ownership of a domain. Domain verification is an optional step to confirm ownership of a domain. Once a domain has been verified in a Mandrill account, other accounts may not have their messages signed by that domain unless they also verify the domain. This prevents other Mandrill accounts from sending mail signed by your domain.
1894
+ # Sends a verification email in order to verify ownership of a domain. Domain verification is a required step to confirm ownership of a domain. Once a domain has been verified in a Mandrill account, other accounts may not have their messages signed by that domain unless they also verify the domain. This prevents other Mandrill accounts from sending mail signed by your domain.
1892
1895
  # @param [String] domain a domain name at which you can receive email
1893
1896
  # @param [String] mailbox a mailbox at the domain where the verification email should be sent
1894
1897
  # @return [Hash] information about the verification that was sent
@@ -1994,5 +1997,59 @@ module Mandrill
1994
1997
  end
1995
1998
 
1996
1999
  end
2000
+ class Metadata
2001
+ attr_accessor :master
2002
+
2003
+ def initialize(master)
2004
+ @master = master
2005
+ end
2006
+
2007
+ # Get the list of custom metadata fields indexed for the account.
2008
+ # @return [Array] the custom metadata fields for the account
2009
+ # - [Hash] return[] the individual custom metadata field info
2010
+ # - [String] name the unique identifier of the metadata field to update
2011
+ # - [String] state the current state of the metadata field, one of "active", "delete", or "index"
2012
+ # - [String] view_template Mustache template to control how the metadata is rendered in your activity log
2013
+ def list()
2014
+ _params = {}
2015
+ return @master.call 'metadata/list', _params
2016
+ end
2017
+
2018
+ # Add a new custom metadata field to be indexed for the account.
2019
+ # @param [String] name a unique identifier for the metadata field
2020
+ # @param [String] view_template optional Mustache template to control how the metadata is rendered in your activity log
2021
+ # @return [Hash] the information saved about the new metadata field
2022
+ # - [String] name the unique identifier of the metadata field to update
2023
+ # - [String] state the current state of the metadata field, one of "active", "delete", or "index"
2024
+ # - [String] view_template Mustache template to control how the metadata is rendered in your activity log
2025
+ def add(name, view_template=nil)
2026
+ _params = {:name => name, :view_template => view_template}
2027
+ return @master.call 'metadata/add', _params
2028
+ end
2029
+
2030
+ # Update an existing custom metadata field.
2031
+ # @param [String] name the unique identifier of the metadata field to update
2032
+ # @param [String] view_template optional Mustache template to control how the metadata is rendered in your activity log
2033
+ # @return [Hash] the information for the updated metadata field
2034
+ # - [String] name the unique identifier of the metadata field to update
2035
+ # - [String] state the current state of the metadata field, one of "active", "delete", or "index"
2036
+ # - [String] view_template Mustache template to control how the metadata is rendered in your activity log
2037
+ def update(name, view_template)
2038
+ _params = {:name => name, :view_template => view_template}
2039
+ return @master.call 'metadata/update', _params
2040
+ end
2041
+
2042
+ # Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
2043
+ # @param [String] name the unique identifier of the metadata field to update
2044
+ # @return [Hash] the information for the deleted metadata field
2045
+ # - [String] name the unique identifier of the metadata field to update
2046
+ # - [String] state the current state of the metadata field, one of "active", "delete", or "index"
2047
+ # - [String] view_template Mustache template to control how the metadata is rendered in your activity log
2048
+ def delete(name)
2049
+ _params = {:name => name}
2050
+ return @master.call 'metadata/delete', _params
2051
+ end
2052
+
2053
+ end
1997
2054
  end
1998
2055
 
@@ -39,6 +39,10 @@ module Mandrill
39
39
  end
40
40
  class UnknownPoolError < Error
41
41
  end
42
+ class NoSendingHistoryError < Error
43
+ end
44
+ class PoorReputationError < Error
45
+ end
42
46
  class UnknownIPError < Error
43
47
  end
44
48
  class InvalidEmptyDefaultPoolError < Error
@@ -47,5 +51,13 @@ module Mandrill
47
51
  end
48
52
  class InvalidDeleteNonEmptyPoolError < Error
49
53
  end
54
+ class InvalidCustomDNSError < Error
55
+ end
56
+ class InvalidCustomDNSPendingError < Error
57
+ end
58
+ class MetadataFieldLimitError < Error
59
+ end
60
+ class UnknownMetadataFieldError < Error
61
+ end
50
62
  end
51
63
 
metadata CHANGED
@@ -1,113 +1,86 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mandrill-api
3
- version: !ruby/object:Gem::Version
4
- hash: 117
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 49
10
- version: 1.0.49
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.55
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Mandrill Devs
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-10-17 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2021-04-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: json
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
26
17
  - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 1
31
- - 7
32
- - 7
18
+ - !ruby/object:Gem::Version
33
19
  version: 1.7.7
34
- - - <
35
- - !ruby/object:Gem::Version
36
- hash: 3
37
- segments:
38
- - 2
39
- - 0
40
- version: "2.0"
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
41
23
  type: :runtime
42
- version_requirements: *id001
43
- - !ruby/object:Gem::Dependency
44
- name: excon
45
24
  prerelease: false
46
- requirement: &id002 !ruby/object:Gem::Requirement
47
- none: false
48
- requirements:
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 1.7.7
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: excon
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
49
37
  - - ">="
50
- - !ruby/object:Gem::Version
51
- hash: 95
52
- segments:
53
- - 0
54
- - 16
55
- - 0
38
+ - !ruby/object:Gem::Version
56
39
  version: 0.16.0
57
- - - <
58
- - !ruby/object:Gem::Version
59
- hash: 15
60
- segments:
61
- - 1
62
- - 0
63
- version: "1.0"
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.0'
64
43
  type: :runtime
65
- version_requirements: *id002
66
- description: A Ruby API library for the Mandrill email as a service platform.
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 0.16.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '1.0'
53
+ description: Deprecated. Replaced by MailchimpTransactional - A Ruby API library for
54
+ the Mandrill email as a service platform.
67
55
  email: community@mandrill.com
68
56
  executables: []
69
-
70
57
  extensions: []
71
-
72
58
  extra_rdoc_files: []
73
-
74
- files:
59
+ files:
75
60
  - lib/mandrill.rb
76
61
  - lib/mandrill/api.rb
77
62
  - lib/mandrill/errors.rb
78
63
  homepage: https://bitbucket.org/mailchimp/mandrill-api-ruby/
79
64
  licenses: []
80
-
65
+ metadata: {}
81
66
  post_install_message:
82
67
  rdoc_options: []
83
-
84
- require_paths:
68
+ require_paths:
85
69
  - lib
86
- required_ruby_version: !ruby/object:Gem::Requirement
87
- none: false
88
- requirements:
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
89
72
  - - ">="
90
- - !ruby/object:Gem::Version
91
- hash: 3
92
- segments:
93
- - 0
94
- version: "0"
95
- required_rubygems_version: !ruby/object:Gem::Requirement
96
- none: false
97
- requirements:
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
98
77
  - - ">="
99
- - !ruby/object:Gem::Version
100
- hash: 3
101
- segments:
102
- - 0
103
- version: "0"
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
104
80
  requirements: []
105
-
106
- rubyforge_project:
107
- rubygems_version: 1.8.24
81
+ rubygems_version: 3.0.3
108
82
  signing_key:
109
- specification_version: 3
110
- summary: A Ruby API library for the Mandrill email as a service platform.
83
+ specification_version: 4
84
+ summary: Deprecated. Replaced by MailchimpTransactional - A Ruby API library for the
85
+ Mandrill email as a service platform.
111
86
  test_files: []
112
-
113
- has_rdoc: