Create Template
print_mail.templates.create(TemplateCreateParams**kwargs) -> Template
POST/print-mail/v1/templates
Create a template. Note that if you want to create a template that works with our template editor, you must use our dashboard.
Create Template
import os
from postgrid import PostGrid
client = PostGrid(
print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"), # This is the default and can be omitted
)
template = client.print_mail.templates.create(
description="Test",
html="<b>Hello</b> {{to.firstName}}",
)
print(template.id){
"id": "template_tBnVEzz878mXLbHQaz86j8",
"object": "template",
"live": false,
"description": "Test",
"html": "<b>Hello</b> {{to.firstName}}!",
"createdAt": "2020-11-12T23:23:47.974Z",
"updatedAt": "2020-11-12T23:23:47.974Z"
}Returns Examples
{
"id": "template_tBnVEzz878mXLbHQaz86j8",
"object": "template",
"live": false,
"description": "Test",
"html": "<b>Hello</b> {{to.firstName}}!",
"createdAt": "2020-11-12T23:23:47.974Z",
"updatedAt": "2020-11-12T23:23:47.974Z"
}