Class: MailchimpTransactional::TemplatesApi
- Inherits:
-
Object
- Object
- MailchimpTransactional::TemplatesApi
- Defined in:
- lib/MailchimpTransactional/api/templates_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add(body = {}) ⇒ Array<(InlineResponse20060, Fixnum, Hash)>
Add template Add a new template.
-
#delete(body = {}) ⇒ Array<(InlineResponse20064, Fixnum, Hash)>
Delete template Delete a template.
-
#info(body = {}) ⇒ Array<(InlineResponse20061, Fixnum, Hash)>
Get template info Get the information for an existing template.
-
#initialize(api_client = ApiClient.default) ⇒ TemplatesApi
constructor
A new instance of TemplatesApi.
-
#list(body = {}) ⇒ Array<(Array<InlineResponse20065>, Fixnum, Hash)>
List templates Return a list of all the templates available to this user.
-
#publish(body = {}) ⇒ Array<(InlineResponse20063, Fixnum, Hash)>
Publish template content Publish the content for the template.
-
#render(body = {}) ⇒ Array<(InlineResponse20066, Fixnum, Hash)>
Render html template Inject content and optionally merge fields into a template, returning the HTML that results.
-
#time_series(body = {}) ⇒ Array<(Array<InlineResponse20049>, Fixnum, Hash)>
Get template history Return the recent history (hourly stats for the last 30 days) for a template.
-
#update(body = {}) ⇒ Array<(InlineResponse20062, Fixnum, Hash)>
Update template Update the code for an existing template.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TemplatesApi
Returns a new instance of TemplatesApi.
19 20 21 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#add(body = {}) ⇒ Array<(InlineResponse20060, Fixnum, Hash)>
Add template Add a new template.
28 29 30 31 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 28 def add(body = {}) data = @api_client.call_api(:POST, '/templates/add', body) data end |
#delete(body = {}) ⇒ Array<(InlineResponse20064, Fixnum, Hash)>
Delete template Delete a template.
38 39 40 41 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 38 def delete(body = {}) data = @api_client.call_api(:POST, '/templates/delete', body) data end |
#info(body = {}) ⇒ Array<(InlineResponse20061, Fixnum, Hash)>
Get template info Get the information for an existing template.
48 49 50 51 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 48 def info(body = {}) data = @api_client.call_api(:POST, '/templates/info', body) data end |
#list(body = {}) ⇒ Array<(Array<InlineResponse20065>, Fixnum, Hash)>
List templates Return a list of all the templates available to this user.
58 59 60 61 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 58 def list(body = {}) data = @api_client.call_api(:POST, '/templates/list', body) data end |
#publish(body = {}) ⇒ Array<(InlineResponse20063, Fixnum, Hash)>
Publish template content Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft.
68 69 70 71 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 68 def publish(body = {}) data = @api_client.call_api(:POST, '/templates/publish', body) data end |
#render(body = {}) ⇒ Array<(InlineResponse20066, Fixnum, Hash)>
Render html template Inject content and optionally merge fields into a template, returning the HTML that results.
78 79 80 81 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 78 def render(body = {}) data = @api_client.call_api(:POST, '/templates/render', body) data end |
#time_series(body = {}) ⇒ Array<(Array<InlineResponse20049>, Fixnum, Hash)>
Get template history Return the recent history (hourly stats for the last 30 days) for a template.
88 89 90 91 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 88 def time_series(body = {}) data = @api_client.call_api(:POST, '/templates/time-series', body) data end |
#update(body = {}) ⇒ Array<(InlineResponse20062, Fixnum, Hash)>
Update template Update the code for an existing template. If null is provided for any fields, the values will remain unchanged.
98 99 100 101 |
# File 'lib/MailchimpTransactional/api/templates_api.rb', line 98 def update(body = {}) data = @api_client.call_api(:POST, '/templates/update', body) data end |