Skip to contents

Retrieves a list of templates from the Postmark API. Templates can be filtered by type and paginated using count and offset parameters.

Usage

template_list(count, type = "all", token = NULL)

Arguments

count

An integer specifying the number of templates to retrieve.

type

A string specifying the template type to filter by: "all", "standard", or "layout". Defaults to "all".

token

Character string. Your Postmark API token. If NULL (default), the function will attempt to retrieve the token using get_token() POSTMARK_SERVER_TOKEN as an environment variable. Check the Postmark's API documentation on how to get a server token.

Value

A data frame (or tibble if tibble is installed) containing the templates information. The returned data includes template details from the Postmark API.

Examples

if (FALSE) { # \dontrun{
# Get the first 10 templates
templates <- template_list(count = 10)

# Get only layout templates
layouts <- template_list(count = 50, type = "layout")

# Use a specific token
templates <- template_list(count = 10, token = "your-api-token")
} # }