3

I assume dynamic template's version is to specify the template's id and version when sending the email. How do I specify dynamic template's version when calling v3 api? I'm using c# client library.

frosty
  • 2,421
  • 6
  • 26
  • 47
  • 4
    You can't send anything except the latest version, SendGrid always uses the active version. Versions are only visible in the admin console. You need to make different templates if your application chooses which to use at runtime. – Stephen Jennings Dec 08 '21 at 01:29
  • 1
    You should add that as the answer @StephenJennings! I'd up vote it. – philnash Dec 08 '21 at 03:36
  • Actually, as @KeithBrings states below, this CAN in fact be done. – Yossi G. Jun 27 '23 at 20:47

3 Answers3

6

It is so profoundly undocumented that I would almost suspect it is intentional but you may simply use d-#{template}.#{version} for the template_id field.

Keith Brings
  • 241
  • 3
  • 5
1

Just click the version and you will see it on the address bar from your browser, e.g.

https://mc.sendgrid.com/dynamic-templates/YOUR_TEMPLATE_ID/version/YOUR_VERSION_ID/editor

And you can activate the version following the offical document. After the verion has been activated, you will be able to send the active version of your template.

Note: You might need to swith your API key from Restricted Access to Full access.

Chuan
  • 3,103
  • 1
  • 19
  • 23
0

Just to expand on Chuan's answer: you can't explicitly use a specific version from the template. Sendgrid always sends the active version.

There might be some workarounds if you use the marketing/test/send_email endpoint, but controlling the template's personalisation might be limited. More info here: https://docs.sendgrid.com/api-reference/send-test-e-mail/send-a-test-marketing-email