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.
577 578 579 |
# File 'lib/mandrill/api.rb', line 577 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
575 576 577 |
# File 'lib/mandrill/api.rb', line 575 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
765 766 767 768 |
# File 'lib/mandrill/api.rb', line 765 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
736 737 738 739 |
# File 'lib/mandrill/api.rb', line 736 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
641 642 643 644 |
# File 'lib/mandrill/api.rb', line 641 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
782 783 784 785 |
# File 'lib/mandrill/api.rb', line 782 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
711 712 713 714 |
# File 'lib/mandrill/api.rb', line 711 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 |