Templates
Manage email templates with MiniJinja syntax
5 endpoints
Endpoints
Method Path Description
GET /v1/templatesGET /v1/templates
POST /v1/templatesPOST /v1/templates
GET /v1/templates/{id}GET /v1/templates/:id
PUT /v1/templates/{id}PUT /v1/templates/:id
DELETE /v1/templates/{id}DELETE /v1/templates/:id
GET /v1/templates
GET /v1/templates
Parameters
Name In Type Required Description
pagequery integerNo Page number (default: 1)
per_pagequery integerNo Items per page (default: 25)
Responses
Status Description
200 Paginated list of templates
401 Unauthorized
Example
cURL
TypeScript
Python
Rust
Go
curl -X GET https://api.euromail.dev/v1/templates \
-H "Authorization: Bearer em_live_..."
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. listTemplates ();
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.list_templates()
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . list_templates () .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. ListTemplates (ctx)
POST /v1/templates
POST /v1/templates
Request Body
Field Type Required Description
aliasstringYes
html_bodystring | nullNo
namestringYes
preheaderstring | nullNo Inbox preview text shown after the subject. Rendered with template_data and added as a hidden block at the top of the HTML part. Omit or leave blank for none.
subjectstringYes
text_bodystring | nullNo
Responses
Status Description
201 Template created
401 Unauthorized
409 Template alias already exists
Example
cURL
TypeScript
Python
Rust
Go
curl -X POST https://api.euromail.dev/v1/templates \
-H "Authorization: Bearer em_live_..." \
-H "Content-Type: application/json" \
-d '{
"subject": "Welcome aboard",
"alias": "...",
"name": "..."
}'
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. createTemplate ({
subject: "Welcome aboard" ,
alias: "..." ,
name: "..."
});
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.create_template(
subject = "Welcome aboard" ,
alias = "..." ,
name = "..." ,
)
use euromail :: { EuroMail , CreateTemplateParams };
let client = EuroMail :: new ( "em_live_..." );
let result = client . create_template ( & CreateTemplateParams {
subject : "Welcome aboard" . into (),
alias : "..." . into (),
name : "..." . into (),
.. Default :: default ()
}) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. CreateTemplate (ctx, euromail . CreateTemplateParams {
Subject: "Welcome aboard" ,
Alias: "..." ,
Name: "..." ,
})
GET /v1/templates/{id}
GET /v1/templates/:id
Parameters
Name In Type Required Description
idpath stringYes Template ID
Responses
Status Description
200 Template details
401 Unauthorized
404 Template not found
Example
cURL
TypeScript
Python
Rust
Go
curl -X GET https://api.euromail.dev/v1/templates/{id} \
-H "Authorization: Bearer em_live_..."
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. getTemplate ( "id_..." );
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.get_template( "id_..." )
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . get_template ( "id_..." ) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. GetTemplate (ctx, "id_..." )
PUT /v1/templates/{id}
PUT /v1/templates/:id
Parameters
Name In Type Required Description
idpath stringYes Template ID
Request Body
Field Type Required Description
html_bodystring | nullNo
namestringYes
preheaderstring | nullNo Inbox preview text shown after the subject. Rendered with template_data and added as a hidden block at the top of the HTML part. Omit or leave blank for none.
subjectstringYes
text_bodystring | nullNo
Responses
Status Description
200 Template updated
401 Unauthorized
404 Template not found
Example
cURL
TypeScript
Python
Rust
Go
curl -X PUT https://api.euromail.dev/v1/templates/{id} \
-H "Authorization: Bearer em_live_..." \
-H "Content-Type: application/json" \
-d '{
"subject": "Welcome aboard",
"name": "..."
}'
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. updateTemplate ({
subject: "Welcome aboard" ,
name: "..."
});
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.update_template(
subject = "Welcome aboard" ,
name = "..." ,
)
use euromail :: { EuroMail , UpdateTemplateParams };
let client = EuroMail :: new ( "em_live_..." );
let result = client . update_template ( & UpdateTemplateParams {
subject : "Welcome aboard" . into (),
name : "..." . into (),
.. Default :: default ()
}) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. UpdateTemplate (ctx, euromail . UpdateTemplateParams {
Subject: "Welcome aboard" ,
Name: "..." ,
})
DELETE /v1/templates/{id}
DELETE /v1/templates/:id
Parameters
Name In Type Required Description
idpath stringYes Template ID
Responses
Status Description
204 Template deleted
401 Unauthorized
404 Template not found
Example
cURL
TypeScript
Python
Rust
Go
curl -X DELETE https://api.euromail.dev/v1/templates/{id} \
-H "Authorization: Bearer em_live_..."
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. deleteTemplate ( "id_..." );
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.delete_template( "id_..." )
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . delete_template ( "id_..." ) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. DeleteTemplate (ctx, "id_..." )