whmcs_get_email_templates
Retrieve email templates from WHMCS by type and language to manage automated communications.
Instructions
Get list of email templates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Template type | |
| language | No | Template language |
Implementation Reference
- src/whmcs-client.ts:1264-1277 (handler)The core handler function `getEmailTemplates` in WhmcsApiClient that executes the WHMCS API call to 'GetEmailTemplates' action, retrieving the list of email templates.async getEmailTemplates(params: { type?: 'general' | 'product' | 'domain' | 'invoice' | 'support' | 'affiliate'; language?: string; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; emailtemplates: { emailtemplate: Array<{ id: number; name: string; subject: string; custom: boolean; }> }; }>('GetEmailTemplates', params); }
- src/index.ts:1085-1100 (registration)Registers the MCP tool 'whmcs_get_email_templates' with input schema validation using Zod and a thin wrapper handler that delegates to WhmcsApiClient.getEmailTemplates.'whmcs_get_email_templates', { title: 'Get Email Templates', description: 'Get list of email templates', inputSchema: { type: z.enum(['general', 'product', 'domain', 'invoice', 'support', 'affiliate']).optional().describe('Template type'), language: z.string().optional().describe('Template language'), }, }, async (params) => { const result = await whmcsClient.getEmailTemplates(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );
- src/index.ts:1089-1092 (schema)Defines the input schema for the tool using Zod, specifying optional 'type' (enum of template categories) and 'language' parameters.inputSchema: { type: z.enum(['general', 'product', 'domain', 'invoice', 'support', 'affiliate']).optional().describe('Template type'), language: z.string().optional().describe('Template language'), },