@param {Object} params the hash of the parameters to pass to the request

- @option params {String} name the name of an existing template

+ @option params {String} name the immutable name of an existing template

@param {Function} onsuccess an optional callback to execute when the API call is successfully made

@param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception

###

###

Update the code for an existing template

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} name the name of an existing template

+ @option params {String} name the immutable name of an existing template

@option params {String} code the new code for the template

@option params {Boolean} publish set to false to update the draft version of the template without publishing

@param {Function} onsuccess an optional callback to execute when the API call is successfully made

###

Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft.

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} name the name of an existing template

+ @option params {String} name the immutable name of an existing template

@param {Function} onsuccess an optional callback to execute when the API call is successfully made

@param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception

###

###

Delete a template

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} name the name of an existing template

+ @option params {String} name the immutable name of an existing template

@param {Function} onsuccess an optional callback to execute when the API call is successfully made

@param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception

###

###

Inject content and optionally merge fields into a template, returning the HTML that results

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} template_name the name of a template that exists in the user's account

+ @option params {String} template_name the immutable name of a template that exists in the user's account

@option params {Array} template_content an array of template content to render. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block

- template_content[] {Object} the injection of a single piece of content into a single editable region

- name {String} the name of the mc:edit editable region to inject into

@master.call('rejects/delete', params, onsuccess, onerror)

+class Inbound

+ constructor: (@master) ->

+

+

+ ###

+ List the domains that have been configured for inbound delivery

+ @param {Object} params the hash of the parameters to pass to the request

+ @param {Function} onsuccess an optional callback to execute when the API call is successfully made

+ @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception

+ ###

+ domains: (params={}, onsuccess, onerror) ->

+ if typeof params == 'function'

+ onerror = onsuccess

+ onsuccess = params

+ params = {}

+

+

+ @master.call('inbound/domains', params, onsuccess, onerror)

+

+ ###

+ List the mailbox routes defined for an inbound domain

+ @param {Object} params the hash of the parameters to pass to the request

+ @option params {String} domain the domain to check

+ @param {Function} onsuccess an optional callback to execute when the API call is successfully made

+ @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception

+ ###

+ routes: (params={}, onsuccess, onerror) ->

+ if typeof params == 'function'

+ onerror = onsuccess

+ onsuccess = params

+ params = {}

+

+

+ @master.call('inbound/routes', params, onsuccess, onerror)

+

+ ###

+ Take a raw MIME document destined for a domain with inbound domains set up, and send it to the inbound hook exactly as if it had been sent over SMTP

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} name the name of an existing template

+ @option params {String} name the immutable name of an existing template

@param {Function} onsuccess an optional callback to execute when the API call is successfully made

@param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception

*/

/*

Update the code for an existing template

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} name the name of an existing template

+ @option params {String} name the immutable name of an existing template

@option params {String} code the new code for the template

@option params {Boolean} publish set to false to update the draft version of the template without publishing

@param {Function} onsuccess an optional callback to execute when the API call is successfully made

/*

Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft.

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} name the name of an existing template

+ @option params {String} name the immutable name of an existing template

@param {Function} onsuccess an optional callback to execute when the API call is successfully made

@param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception

*/

/*

Delete a template

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} name the name of an existing template

+ @option params {String} name the immutable name of an existing template

@param {Function} onsuccess an optional callback to execute when the API call is successfully made

@param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception

*/

/*

Inject content and optionally merge fields into a template, returning the HTML that results

@param {Object} params the hash of the parameters to pass to the request

- @option params {String} template_name the name of a template that exists in the user's account

+ @option params {String} template_name the immutable name of a template that exists in the user's account

@option params {Array} template_content an array of template content to render. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block

- template_content[] {Object} the injection of a single piece of content into a single editable region

- name {String} the name of the mc:edit editable region to inject into

})();

+ Inbound = (function() {

+

+ function Inbound(master) {

+ this.master = master;

+ }

+

+ /*

+ List the domains that have been configured for inbound delivery

+ @param {Object} params the hash of the parameters to pass to the request

+ @param {Function} onsuccess an optional callback to execute when the API call is successfully made

+ @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception