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
-
#initialize(master) ⇒ Messages
constructor
A new instance of Messages.
-
#parse(raw_message) ⇒ Hash
Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces.
-
#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.
-
#send(message, async = false) ⇒ Array
Send a new transactional message through Mandrill.
-
#send_raw(raw_message, from_email = nil, from_name = nil, to = nil, async = false) ⇒ 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) ⇒ Array
Send a new transactional message through Mandrill using a template.
Constructor Details
#initialize(master) ⇒ Messages
Returns a new instance of Messages.
663 664 665 |
# File 'lib/mandrill/api.rb', line 663 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
661 662 663 |
# File 'lib/mandrill/api.rb', line 661 def master @master end |
Instance Method Details
#parse(raw_message) ⇒ Hash
Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces
853 854 855 856 |
# File 'lib/mandrill/api.rb', line 853 def parse() _params = {:raw_message => } return @master.call 'messages/parse', _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
824 825 826 827 |
# File 'lib/mandrill/api.rb', line 824 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 |
#send(message, async = false) ⇒ Array
Send a new transactional message through Mandrill
728 729 730 731 |
# File 'lib/mandrill/api.rb', line 728 def send(, async=false) _params = {:message => , :async => async} return @master.call 'messages/send', _params end |
#send_raw(raw_message, from_email = nil, from_name = nil, to = nil, async = false) ⇒ Array
Take a raw MIME document for a message, and send it exactly as if it were sent over the SMTP protocol
871 872 873 874 |
# File 'lib/mandrill/api.rb', line 871 def send_raw(, from_email=nil, from_name=nil, to=nil, async=false) _params = {:raw_message => , :from_email => from_email, :from_name => from_name, :to => to, :async => async} return @master.call 'messages/send-raw', _params end |
#send_template(template_name, template_content, message, async = false) ⇒ Array
Send a new transactional message through Mandrill using a template
799 800 801 802 |
# File 'lib/mandrill/api.rb', line 799 def send_template(template_name, template_content, , async=false) _params = {:template_name => template_name, :template_content => template_content, :message => , :async => async} return @master.call 'messages/send-template', _params end |