Skip to contents

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

Usage

template_id(sg_mail, template_id, 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"

force

pass template_id validation. default is FALSE.

Value

sg_mail class with template id.

Examples


mail()%>%
  template_id("d-4ad23ad40a0e47d0a0232b85f24ca5c2")
#> SendGrid Mail - 
#>    from   : (required)
#>    to     : (required)
#>    subject: (required)
#>    template_id: nchr[34] d-4ad23ad40a0e47d0a0232b85f24ca5c2
#>      data: json below
#> {} 
#>    attach : (optional)

mail() %>%
  template_id("foo", force = TRUE)
#> SendGrid Mail - 
#>    from   : (required)
#>    to     : (required)
#>    subject: (required)
#>    template_id: nchr[3] foo
#>      data: json below
#> {} 
#>    attach : (optional)