Class: Mailgun::Message
Instance Method Summary collapse
-
#initialize(mailgun, domain) ⇒ Message
constructor
A new instance of Message.
-
#messages_url ⇒ Object
Helper method to generate the proper url for Mailgun message API calls.
-
#send_email(parameters = {}) ⇒ Object
send email.
Constructor Details
#initialize(mailgun, domain) ⇒ Message
Returns a new instance of Message.
3 4 5 6 |
# File 'lib/mailgun/message.rb', line 3 def initialize(mailgun, domain) @mailgun = mailgun @domain = domain end |
Instance Method Details
#messages_url ⇒ Object
Helper method to generate the proper url for Mailgun message API calls
24 25 26 |
# File 'lib/mailgun/message.rb', line 24 def "#{@mailgun.base_url}/#{@domain}/messages" end |
#send_email(parameters = {}) ⇒ Object
send email
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mailgun/message.rb', line 9 def send_email(parameters={}) # options: # :from, :to, :cc, :bcc, :subject, :text, :html # :with_attachment # :with_attachments # :at for delayed delivery time option # :in_test_mode BOOL. override the @use_test_mode setting # :tags to add tags to the email # :track BOOL Mailgun.submit(:post, , parameters) end |