dynamic_template: Add dynamic template

View source: R/dynamic-templates.R

dynamic_templateR Documentation

Add dynamic template

Description

Create dynamic templates at https://mc.sendgrid.com/dynamic-templates.

Usage

dynamic_template(sg_mail, template_id, template_data, force = FALSE)

Arguments

sg_mail

(required) mail object from package

template_id

(required) template_id start "d-" and 32-length only digit and lower case alphabet like "d-4ad23ad40a0e47d0a0232b85f24ca5c2"

template_data

A key-value list for template data. (See https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates)

force

pass template_id validation. default is FALSE.

Value

sg_mail class with dynamic template

Examples

mail() %>%
  dynamic_template("d-4ad23ad40a0e47d0a0232b85f24ca5c2", list(first_name = "Amanda", link = "foo"))

mail() %>%
  dynamic_template(template_id = "foo",
    template_data = list(first_name = "Amanda", link = "foo"),
    force = TRUE)

sendgridr documentation built on Nov. 10, 2022, 5:15 p.m.