---
title: "Send templates"
description: "Send a saved template, such as a verification code, by name."
url: "https://docs.goomzo.africa/docs/developers/php-sdk/templates"
docs_index: /llms.txt
lastUpdated: 2026-11-12
section: "Guides"
related:
  - /docs/developers/php-sdk/messages
  - /docs/developers/php-sdk/customers
  - /docs/developers/php-sdk/webhooks
---

> For an index of all documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt). Any page is also available as Markdown by adding .md to its URL.

# Send templates

> Send a saved template, such as a verification code, by name.

Send a saved template by its name, with the values it needs. `{{secret.x}}` values are delivered, but kept as
`••••••`. See [Send templates](https://docs.goomzo.africa/docs/developers/messages/templates?utm_source=llms&utm_medium=ai).

## Send a template

For a template `auth_1` that reads `Your code is {{secret.code}}. It expires in {{data.minutes}} minutes.`:

```php
$message = $goomzo->messages->sendOne(
    ['to' => '+255712345678', 'template' => 'auth_1', 'variables' => ['code' => '482913', 'minutes' => '10']],
    idempotencyKey: "login-{$attemptId}",
);

$message['private']; // true
$message['content']['text']; // 'Your code is ••••••. It expires in 10 minutes.'
```

## Manage templates

```php
$goomzo->templates->create([
    'name' => 'auth_1',
    'channel' => 'sms',
    'category' => 'authentication',
    'content' => ['text' => 'Your code is {{secret.code}}. It expires in {{data.minutes}} minutes.'],
]);

$templates = $goomzo->templates->list(['channel' => 'sms']);
```

| Method                             | Does                                                |
| ---------------------------------- | --------------------------------------------------- |
| `templates->list($query)`          | Lists your templates, by `channel` or `category`.   |
| `templates->get($id)`              | Gets one.                                           |
| `templates->create($template)`     | Saves one. A WhatsApp one can be submitted to Meta. |
| `templates->update($id, $changes)` | Changes one.                                        |
| `templates->delete($id)`           | Deletes one.                                        |
| `whatsapp->templates->list()`      | Lists the templates on your WhatsApp account.       |

## Next steps

- [Create templates](https://docs.goomzo.africa/docs/developers/templates/create?utm_source=llms&utm_medium=ai)
- [Authentication templates](https://docs.goomzo.africa/docs/developers/templates/authentication?utm_source=llms&utm_medium=ai)

---

For an index of all available documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt)
