Create a Template

Create a new email template in SenderWiz using HTML content or a zip archive.

🆕 Create a Template

This endpoint allows you to upload and save a new template either via direct HTML content or using a ZIP archive.


🔹 HTTP Request

POST API-URL/templates

📝 POST Parameters

Parameter
Type
Required
Description

template

array

Yes

An array containing the template details.

📦 Data Block (Required)

Parameter
Type
Required
Description

name

string

Yes

The template name.

content

string

Yes

HTML content of the template.

archive

string

No

File content of a ZIP archive (alternative to content).

inline_css

Yes/No

No

Enable or disable inline CSS (yes or no).


🔐 Authorization Header

X-API-KEY: your-api-key-here

💻 PHP Example

// CREATE A NEW TEMPLATE
$rand = rand();
$response = $endpoint->create([
    'name'          => 'My API template ' . $rand,
    'content'       => file_get_contents(__DIR__ . '/template-example.html'),
    //'archive'     => file_get_contents(__DIR__ . '/template-example.zip'),
    'inline_css'    => 'no', // yes|no
]);

// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';

📦 Sample JSON Response

{
  "status": "success",
  "template_uid": "tpl9847xyz123"
}

Last updated