Class: MailchimpTransactional::TemplatesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/MailchimpTransactional/api/templates_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_clientObject

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.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(InlineResponse20060, Fixnum, Hash)>)

    InlineResponse20060 data, response status code and response headers



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.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(InlineResponse20064, Fixnum, Hash)>)

    InlineResponse20064 data, response status code and response headers



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.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(InlineResponse20061, Fixnum, Hash)>)

    InlineResponse20061 data, response status code and response headers



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.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(Array<InlineResponse20065>, Fixnum, Hash)>)

    Array<InlineResponse20065> data, response status code and response headers



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.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(InlineResponse20063, Fixnum, Hash)>)

    InlineResponse20063 data, response status code and response headers



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.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(InlineResponse20066, Fixnum, Hash)>)

    InlineResponse20066 data, response status code and response headers



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.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(Array<InlineResponse20049>, Fixnum, Hash)>)

    Array<InlineResponse20049> data, response status code and response headers



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.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(InlineResponse20062, Fixnum, Hash)>)

    InlineResponse20062 data, response status code and response headers



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