mandrill-api 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mandrill/api.rb +9 -6
- metadata +2 -2
data/lib/mandrill/api.rb
CHANGED
@@ -472,12 +472,13 @@ module Mandrill
|
|
472
472
|
# - [String] type the MIME type of the attachment - allowed types are text/*, image/*, and application/pdf
|
473
473
|
# - [String] name the file name of the attachment
|
474
474
|
# - [String] content the content of the attachment as a base64-encoded string
|
475
|
+
# @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 fewer than 100 recipients; messages with more than 100 recipients are always sent asynchronously, regardless of the value of async.
|
475
476
|
# @return [Array] of structs for each recipient containing the key "email" with the email address and "status" as either "sent", "queued", or "rejected"
|
476
477
|
# - [Hash] return[] the sending results for a single recipient
|
477
478
|
# - [String] email the email address of the recipient
|
478
479
|
# - [String] status the sending status of the recipient - either "sent", "queued", "rejected", or "invalid"
|
479
|
-
def send(message)
|
480
|
-
_params = {:message => message}
|
480
|
+
def send(message, async=false)
|
481
|
+
_params = {:message => message, :async => async}
|
481
482
|
return @master.call 'messages/send', _params
|
482
483
|
end
|
483
484
|
|
@@ -528,12 +529,13 @@ module Mandrill
|
|
528
529
|
# - [String] type the MIME type of the attachment - allowed types are text/*, image/*, and application/pdf
|
529
530
|
# - [String] name the file name of the attachment
|
530
531
|
# - [String] content the content of the attachment as a base64-encoded string
|
532
|
+
# @param [Boolean] async enable a background sending mode that is optimized for bulk sending. In async mode, messages/sendTemplate 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 fewer than 100 recipients; messages with more than 100 recipients are always sent asynchronously, regardless of the value of async.
|
531
533
|
# @return [Array] of structs for each recipient containing the key "email" with the email address and "status" as either "sent", "queued", or "rejected"
|
532
534
|
# - [Hash] return[] the sending results for a single recipient
|
533
535
|
# - [String] email the email address of the recipient
|
534
536
|
# - [String] status the sending status of the recipient - either "sent", "queued", "rejected", or "invalid"
|
535
|
-
def send_template(template_name, template_content, message)
|
536
|
-
_params = {:template_name => template_name, :template_content => template_content, :message => message}
|
537
|
+
def send_template(template_name, template_content, message, async=false)
|
538
|
+
_params = {:template_name => template_name, :template_content => template_content, :message => message, :async => async}
|
537
539
|
return @master.call 'messages/send-template', _params
|
538
540
|
end
|
539
541
|
|
@@ -590,12 +592,13 @@ module Mandrill
|
|
590
592
|
# @param [String, nil] from_name optionally define the sender alias
|
591
593
|
# @param [Array, nil] to optionally define the recipients to receive the message - otherwise we'll use the To, Cc, and Bcc headers provided in the document
|
592
594
|
# - [String] to[] the email address of the recipint
|
595
|
+
# @param [Boolean] async enable a background sending mode that is optimized for bulk sending. In async mode, messages/sendRaw 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 fewer than 100 recipients; messages with more than 100 recipients are always sent asynchronously, regardless of the value of async.
|
593
596
|
# @return [Array] of structs for each recipient containing the key "email" with the email address and "status" as either "sent", "queued", or "rejected"
|
594
597
|
# - [Hash] return[] the sending results for a single recipient
|
595
598
|
# - [String] email the email address of the recipient
|
596
599
|
# - [String] status the sending status of the recipient - either "sent", "queued", "rejected", or "invalid"
|
597
|
-
def send_raw(raw_message, from_email=nil, from_name=nil, to=nil)
|
598
|
-
_params = {:raw_message => raw_message, :from_email => from_email, :from_name => from_name, :to => to}
|
600
|
+
def send_raw(raw_message, from_email=nil, from_name=nil, to=nil, async=false)
|
601
|
+
_params = {:raw_message => raw_message, :from_email => from_email, :from_name => from_name, :to => to, :async => async}
|
599
602
|
return @master.call 'messages/send-raw', _params
|
600
603
|
end
|
601
604
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: mandrill-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mandrill Devs
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-10-02 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|