frosty
frosty

Reputation: 2852

How do I specify dynamic template's version when calling v3 api?

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.

Upvotes: 4

Views: 1935

Answers (3)

Keith Brings
Keith Brings

Reputation: 381

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.

Upvotes: 11

thiago-barbosa
thiago-barbosa

Reputation: 41

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

Upvotes: 0

Chuan
Chuan

Reputation: 3453

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.

Upvotes: 1

Related Questions