Class: MailUp::Console::Email
- Inherits:
-
Object
- Object
- MailUp::Console::Email
- Defined in:
- lib/mailup/console/email.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Instance Method Summary collapse
-
#get_deferred_confirmation_date(sending_id) ⇒ Object
Retrieves the earliest date to schedule the given sending task.
-
#get_deferred_confirmation_queque ⇒ Object
Retrieves the list of email messages that are currently queued up for “deferred sending”.
-
#get_immediate_confirmation_queque ⇒ Object
Retrieves the list of email messages that are currently queued up for “immediate sending”.
-
#get_undefined_confirmation_queque ⇒ Object
Retrieves the list of email messages that are neither “scheduled” nor queued up for “immediate sending”.
-
#initialize(api) ⇒ Email
constructor
A new instance of Email.
-
#send(message_id, email) ⇒ JSON
Send single email message to specified recipient.
-
#send_deferred_confirmation(sending_id, date = nil) ⇒ Object
Sets up a mailing for scheduled delivery.
-
#send_immediate_confirmation(sending_id) ⇒ Object
Schedules a mailing for immediate sending.
Constructor Details
#initialize(api) ⇒ Email
Returns a new instance of Email.
6 7 8 |
# File 'lib/mailup/console/email.rb', line 6 def initialize(api) @api = api end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
4 5 6 |
# File 'lib/mailup/console/email.rb', line 4 def api @api end |
Instance Method Details
#get_deferred_confirmation_date(sending_id) ⇒ Object
Retrieves the earliest date to schedule the given sending task.
45 46 47 |
# File 'lib/mailup/console/email.rb', line 45 def get_deferred_confirmation_date(sending_id) @api.get("#{@api.path}/Email/Sendings/#{sending_id}/Deferred") end |
#get_deferred_confirmation_queque ⇒ Object
Retrieves the list of email messages that are currently queued up for “deferred sending”.
68 69 70 |
# File 'lib/mailup/console/email.rb', line 68 def get_deferred_confirmation_queque @api.get("#{@api.path}/Email/Sendings/Deferred") end |
#get_immediate_confirmation_queque ⇒ Object
Retrieves the list of email messages that are currently queued up for “immediate sending”.
61 62 63 |
# File 'lib/mailup/console/email.rb', line 61 def get_immediate_confirmation_queque @api.get("#{@api.path}/Email/Sendings/Immediate") end |
#get_undefined_confirmation_queque ⇒ Object
Retrieves the list of email messages that are neither “scheduled” nor queued up for “immediate sending”.
75 76 77 |
# File 'lib/mailup/console/email.rb', line 75 def get_undefined_confirmation_queque @api.get("#{@api.path}/Email/Sendings/Undefined") end |
#send(message_id, email) ⇒ JSON
Send single email message to specified recipient.
29 30 31 |
# File 'lib/mailup/console/email.rb', line 29 def send(, email) @api.post("#{@api.path}/Email/Send", body: {:idMessage => , :Email => email}) end |
#send_deferred_confirmation(sending_id, date = nil) ⇒ Object
Sets up a mailing for scheduled delivery
54 55 56 |
# File 'lib/mailup/console/email.rb', line 54 def send_deferred_confirmation(sending_id, date = nil) @api.post("#{@api.path}/Email/Sendings/#{sending_id}/Deferred", body: {'Date' => date}) end |
#send_immediate_confirmation(sending_id) ⇒ Object
Schedules a mailing for immediate sending
37 38 39 |
# File 'lib/mailup/console/email.rb', line 37 def send_immediate_confirmation(sending_id) @api.post("#{@api.path}/Email/Sendings/#{sending_id}/Immediate") end |