Struct mailchimp_api::templates::Templates
source · pub struct Templates {
pub client: Client,
}
Fields
client: Client
Implementations
sourceimpl Templates
impl Templates
sourcepub async fn get(
&self,
fields: &[String],
exclude_fields: &[String],
count: i64,
offset: i64,
created_by: &str,
since_date_created: &str,
before_date_created: &str,
type_: &str,
category: &str,
folder_id: &str,
sort_field: GetTemplatesSortField,
sort_dir: SortDir
) -> Result<TemplatesData>
pub async fn get(
&self,
fields: &[String],
exclude_fields: &[String],
count: i64,
offset: i64,
created_by: &str,
since_date_created: &str,
before_date_created: &str,
type_: &str,
category: &str,
folder_id: &str,
sort_field: GetTemplatesSortField,
sort_dir: SortDir
) -> Result<TemplatesData>
List templates.
This function performs a GET
to the /templates
endpoint.
Get a list of an account’s available templates.
Parameters:
fields: &[String]
– A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.exclude_fields: &[String]
– A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.count: i64
– The number of records to return. Default value is 10. Maximum value is 1000.offset: i64
– Used for pagination, this it the number of records from a collection to skip. Default value is 0.created_by: &str
– The Mailchimp account user who created the template.since_date_created: &str
– Restrict the response to templates created after the set date. Uses ISO 8601 time format: 2015-10-21T15:41:36+00:00.before_date_created: &str
– Restrict the response to templates created before the set date. Uses ISO 8601 time format: 2015-10-21T15:41:36+00:00.type_: &str
– Limit results based on template type.category: &str
– Limit results based on category.folder_id: &str
– The name of the folder.sort_field: crate::types::GetTemplatesSortField
– Returns user templates sorted by the specified field.sort_dir: crate::types::SortDir
– Determines the order direction for sorted results.
sourcepub async fn post(&self, body: &TemplateInstance) -> Result<Templates>
pub async fn post(&self, body: &TemplateInstance) -> Result<Templates>
Add template.
This function performs a POST
to the /templates
endpoint.
Create a new template for the account. Only Classic templates are supported.
sourcepub async fn get_templates(
&self,
fields: &[String],
exclude_fields: &[String],
template_id: &str
) -> Result<Templates>
pub async fn get_templates(
&self,
fields: &[String],
exclude_fields: &[String],
template_id: &str
) -> Result<Templates>
Get template info.
This function performs a GET
to the /templates/{template_id}
endpoint.
Get information about a specific template.
Parameters:
fields: &[String]
– A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.exclude_fields: &[String]
– A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.template_id: &str
– The unique id for the template.
sourcepub async fn delete(&self, template_id: &str) -> Result<()>
pub async fn delete(&self, template_id: &str) -> Result<()>
Delete template.
This function performs a DELETE
to the /templates/{template_id}
endpoint.
Delete a specific template.
Parameters:
template_id: &str
– The unique id for the template.
sourcepub async fn patch(
&self,
template_id: &str,
body: &TemplateInstance
) -> Result<Templates>
pub async fn patch(
&self,
template_id: &str,
body: &TemplateInstance
) -> Result<Templates>
Update template.
This function performs a PATCH
to the /templates/{template_id}
endpoint.
Update the name, HTML, or folder_id
of an existing template.
Parameters:
template_id: &str
– The unique id for the template.
sourcepub async fn get_default_content(
&self,
fields: &[String],
exclude_fields: &[String],
template_id: &str
) -> Result<TemplateDefaultContent>
pub async fn get_default_content(
&self,
fields: &[String],
exclude_fields: &[String],
template_id: &str
) -> Result<TemplateDefaultContent>
View default content.
This function performs a GET
to the /templates/{template_id}/default-content
endpoint.
Get the sections that you can edit in a template, including each section’s default content.
Parameters:
fields: &[String]
– A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.exclude_fields: &[String]
– A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.template_id: &str
– The unique id for the template.