Class: Sendgrid::API::Newsletter::Schedule::Services
- Includes:
- Utils
- Defined in:
- lib/sendgrid/api/newsletter/schedule.rb
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#add(marketing_email, options = {}) ⇒ Entities::Response
Schedule a delivery time for an existing Marketing Email.
-
#delete(marketing_email) ⇒ Entities::Response
Cancel a scheduled send for a Marketing Email.
-
#get(marketing_email) ⇒ Entities::Schedule
Retrieve the scheduled delivery time for an existing Marketing Email.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Sendgrid::API::Service
Instance Method Details
#add(marketing_email, options = {}) ⇒ Entities::Response
Schedule a delivery time for an existing Marketing Email.
26 27 28 29 30 31 32 |
# File 'lib/sendgrid/api/newsletter/schedule.rb', line 26 def add(marketing_email, = {}) .keep_if {|key, value| [:at, :after].include?(key) } [:at] = format_time([:at]) if .member?(:at) params = { :name => extract_marketing_email(marketing_email) } params.merge!() if .any? perform_request(Entities::Response, 'newsletter/schedule/add.json', params) end |
#delete(marketing_email) ⇒ Entities::Response
Cancel a scheduled send for a Marketing Email.
49 50 51 52 |
# File 'lib/sendgrid/api/newsletter/schedule.rb', line 49 def delete(marketing_email) params = { :name => extract_marketing_email(marketing_email) } perform_request(Entities::Response, 'newsletter/schedule/delete.json', params) end |
#get(marketing_email) ⇒ Entities::Schedule
Retrieve the scheduled delivery time for an existing Marketing Email.
39 40 41 42 |
# File 'lib/sendgrid/api/newsletter/schedule.rb', line 39 def get(marketing_email) params = { :name => extract_marketing_email(marketing_email) } perform_request(Entities::Schedule, 'newsletter/schedule/get.json', params) end |