class MailchimpTransactional::TemplatesApi
Attributes
Public Class Methods
# File lib/MailchimpTransactional/api/templates_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Add template Add a new template. @param body @param [Hash] opts the optional parameters @return [Array<(InlineResponse20057, Fixnum, Hash)>] InlineResponse20057 data, response status code and response headers
# File lib/MailchimpTransactional/api/templates_api.rb, line 28 def add(body = {}) data = @api_client.call_api(:POST, '/templates/add', body) data end
Delete template Delete a template. @param body @param [Hash] opts the optional parameters @return [Array<(InlineResponse20061, Fixnum, Hash)>] InlineResponse20061 data, response status code and response headers
# File lib/MailchimpTransactional/api/templates_api.rb, line 38 def delete(body = {}) data = @api_client.call_api(:POST, '/templates/delete', body) data end
Get template info Get the information for an existing template. @param body @param [Hash] opts the optional parameters @return [Array<(InlineResponse20058, Fixnum, Hash)>] InlineResponse20058 data, response status code and response headers
# File lib/MailchimpTransactional/api/templates_api.rb, line 48 def info(body = {}) data = @api_client.call_api(:POST, '/templates/info', body) data end
List templates Return a list of all the templates available to this user. @param body @param [Hash] opts the optional parameters @return [Array<(Array<InlineResponse20062>, Fixnum, Hash)>] Array<InlineResponse20062> data, response status code and response headers
# File lib/MailchimpTransactional/api/templates_api.rb, line 58 def list(body = {}) data = @api_client.call_api(:POST, '/templates/list', body) data end
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. @param body @param [Hash] opts the optional parameters @return [Array<(InlineResponse20060, Fixnum, Hash)>] InlineResponse20060 data, response status code and response headers
# File lib/MailchimpTransactional/api/templates_api.rb, line 68 def publish(body = {}) data = @api_client.call_api(:POST, '/templates/publish', body) data end
Render html template Inject content and optionally merge fields into a template, returning the HTML that results. @param body @param [Hash] opts the optional parameters @return [Array<(InlineResponse20063, Fixnum, Hash)>] InlineResponse20063 data, response status code and response headers
# File lib/MailchimpTransactional/api/templates_api.rb, line 78 def render(body = {}) data = @api_client.call_api(:POST, '/templates/render', body) data end
Get template history Return the recent history (hourly stats for the last 30 days) for a template. @param body @param [Hash] opts the optional parameters @return [Array<(Array<InlineResponse20046>, Fixnum, Hash)>] Array<InlineResponse20046> data, response status code and response headers
# 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 template Update the code for an existing template. If null is provided for any fields, the values will remain unchanged. @param body @param [Hash] opts the optional parameters @return [Array<(InlineResponse20059, Fixnum, Hash)>] InlineResponse20059 data, response status code and response headers
# File lib/MailchimpTransactional/api/templates_api.rb, line 98 def update(body = {}) data = @api_client.call_api(:POST, '/templates/update', body) data end