create_template
Create reusable email templates with dynamic variables for consistent transactional email campaigns in GetMailer.
Instructions
Create a new email template
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Template name | |
| subject | Yes | Email subject (can include {{variables}}) | |
| html | Yes | HTML content (can include {{variables}}) | |
| text | No | Plain text content (optional) |
Implementation Reference
- src/index.ts:158-183 (registration)Registration of the 'create_template' tool in the ListTools response, including name, description, and input schema definition.{ name: 'create_template', description: 'Create a new email template', inputSchema: { type: 'object' as const, properties: { name: { type: 'string', description: 'Template name', }, subject: { type: 'string', description: 'Email subject (can include {{variables}})', }, html: { type: 'string', description: 'HTML content (can include {{variables}})', }, text: { type: 'string', description: 'Plain text content (optional)', }, }, required: ['name', 'subject', 'html'], }, },
- src/index.ts:394-402 (handler)Handler implementation for 'create_template': performs a POST request to '/api/templates' API endpoint with the input arguments and returns the JSON response.case 'create_template': { const result = await apiRequest('/api/templates', { method: 'POST', body: JSON.stringify(args), }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; }