sparkpost v0.4.0 SparkPost.Template

The SparkPost Template API for working with templates. Use SparkPost.Template.preview/2 to preview a template.

Check out the documentation for each function or use the SparkPost API reference for details.

Returned by SparkPost.template.preview/2.

  • from

    • email
    • name
  • subject
  • reply_to
  • text
  • html
  • headers

Summary

Functions

Generate a preview of an existing template

Functions

preview(template, substitution_data)

Generate a preview of an existing template.

Parameters

  • %SparkPost.Content.TemplateRef{} consisting of:
  • template_id: The string id of the template to retrieve a preview or.
  • use_draft_template: If true, previews the most recent draft template. If false, previews the most recent published template. If nil, previews the most recently template version period.
  • substitution_data: k,v map consisting of substituions. See the SparkPost Substitutions Reference for more details.