Class: Mandrill::Messages
- Inherits:
-
Object
- Object
- Mandrill::Messages
- Defined in:
- lib/mandrill/api.rb
Instance Attribute Summary collapse
-
#master ⇒ Object
Returns the value of attribute master.
Instance Method Summary collapse
-
#cancel_scheduled(id) ⇒ Hash
Cancels a scheduled email.
-
#info(id) ⇒ Hash
Get the information for a single recently sent message.
-
#initialize(master) ⇒ Messages
constructor
A new instance of Messages.
-
#list_scheduled(to = nil) ⇒ Array
Queries your scheduled emails by sender or recipient, or both.
-
#parse(raw_message) ⇒ Hash
Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces.
-
#reschedule(id, send_at) ⇒ Hash
Reschedules a scheduled email.
-
#search(query = '*', date_from = nil, date_to = nil, tags = nil, senders = nil, limit = 100) ⇒ Array
Search the content of recently sent messages and optionally narrow by date range, tags and senders.
-
#search_time_series(query = '*', date_from = nil, date_to = nil, tags = nil, senders = nil) ⇒ Array
Search the content of recently sent messages and return the aggregated hourly stats for matching messages.
-
#send(message, async = false, ip_pool = nil, send_at = nil) ⇒ Array
Send a new transactional message through Mandrill.
-
#send_raw(raw_message, from_email = nil, from_name = nil, to = nil, async = false, ip_pool = nil, send_at = nil) ⇒ Array
Take a raw MIME document for a message, and send it exactly as if it were sent over the SMTP protocol.
-
#send_template(template_name, template_content, message, async = false, ip_pool = nil, send_at = nil) ⇒ Array
Send a new transactional message through Mandrill using a template.
Constructor Details
#initialize(master) ⇒ Messages
Returns a new instance of Messages.
673 674 675 |
# File 'lib/mandrill/api.rb', line 673 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
671 672 673 |
# File 'lib/mandrill/api.rb', line 671 def master @master end |
Instance Method Details
#cancel_scheduled(id) ⇒ Hash
Cancels a scheduled email.
987 988 989 990 |
# File 'lib/mandrill/api.rb', line 987 def cancel_scheduled(id) _params = {:id => id} return @master.call 'messages/cancel-scheduled', _params end |
#info(id) ⇒ Hash
Get the information for a single recently sent message
909 910 911 912 |
# File 'lib/mandrill/api.rb', line 909 def info(id) _params = {:id => id} return @master.call 'messages/info', _params end |
#list_scheduled(to = nil) ⇒ Array
Queries your scheduled emails by sender or recipient, or both.
973 974 975 976 |
# File 'lib/mandrill/api.rb', line 973 def list_scheduled(to=nil) _params = {:to => to} return @master.call 'messages/list-scheduled', _params end |
#parse(raw_message) ⇒ Hash
Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces
938 939 940 941 |
# File 'lib/mandrill/api.rb', line 938 def parse() _params = {:raw_message => } return @master.call 'messages/parse', _params end |
#reschedule(id, send_at) ⇒ Hash
Reschedules a scheduled email.
1002 1003 1004 1005 |
# File 'lib/mandrill/api.rb', line 1002 def reschedule(id, send_at) _params = {:id => id, :send_at => send_at} return @master.call 'messages/reschedule', _params end |
#search(query = '*', date_from = nil, date_to = nil, tags = nil, senders = nil, limit = 100) ⇒ Array
Search the content of recently sent messages and optionally narrow by date range, tags and senders
852 853 854 855 |
# File 'lib/mandrill/api.rb', line 852 def search(query='*', date_from=nil, date_to=nil, =nil, senders=nil, limit=100) _params = {:query => query, :date_from => date_from, :date_to => date_to, :tags => , :senders => senders, :limit => limit} return @master.call 'messages/search', _params end |
#search_time_series(query = '*', date_from = nil, date_to = nil, tags = nil, senders = nil) ⇒ Array
Search the content of recently sent messages and return the aggregated hourly stats for matching messages
876 877 878 879 |
# File 'lib/mandrill/api.rb', line 876 def search_time_series(query='*', date_from=nil, date_to=nil, =nil, senders=nil) _params = {:query => query, :date_from => date_from, :date_to => date_to, :tags => , :senders => senders} return @master.call 'messages/search-time-series', _params end |
#send(message, async = false, ip_pool = nil, send_at = nil) ⇒ Array
Send a new transactional message through Mandrill
740 741 742 743 |
# File 'lib/mandrill/api.rb', line 740 def send(, async=false, ip_pool=nil, send_at=nil) _params = {:message => , :async => async, :ip_pool => ip_pool, :send_at => send_at} return @master.call 'messages/send', _params end |
#send_raw(raw_message, from_email = nil, from_name = nil, to = nil, async = false, ip_pool = nil, send_at = nil) ⇒ Array
Take a raw MIME document for a message, and send it exactly as if it were sent over the SMTP protocol
958 959 960 961 |
# File 'lib/mandrill/api.rb', line 958 def send_raw(, from_email=nil, from_name=nil, to=nil, async=false, ip_pool=nil, send_at=nil) _params = {:raw_message => , :from_email => from_email, :from_name => from_name, :to => to, :async => async, :ip_pool => ip_pool, :send_at => send_at} return @master.call 'messages/send-raw', _params end |
#send_template(template_name, template_content, message, async = false, ip_pool = nil, send_at = nil) ⇒ Array
Send a new transactional message through Mandrill using a template
813 814 815 816 |
# File 'lib/mandrill/api.rb', line 813 def send_template(template_name, template_content, , async=false, ip_pool=nil, send_at=nil) _params = {:template_name => template_name, :template_content => template_content, :message => , :async => async, :ip_pool => ip_pool, :send_at => send_at} return @master.call 'messages/send-template', _params end |