TouchDesigner integration for Veil Mail. A thin wrapper around the Python SDK with an extension class, callback scripts, and parameter definitions for building VeilMail-powered TouchDesigner components.
Veil Mail is the only email API with a first-class TouchDesigner integration. Resend, SendGrid, Mailgun, and Postmark offer no TouchDesigner support — you're left wiring HTTP requests from
tduscripts and managing blocking calls on the cook thread yourself. This integration gives you a COMP extension, threaded API calls that don't stall the timeline, and callback wiring for UI-driven workflows.Common use cases in TouchDesigner projects: live-event confirmations and alerts, interactive installation notifications, form submission emails from signage and kiosks, receipts from retail or ticketing experiences, show-control triggers, and any Python-driven flow where you need reliable transactional email without blocking the cook.
Other Veil Mail SDKs: Unity · Unreal Engine · Python · Node.js · 11 more
TouchDesigner runs Python 3.11 natively, so the existing Veil Mail Python SDK works as-is. This integration adds TouchDesigner-specific conveniences: threaded API calls that won't block the cook thread, a COMP extension with custom parameters, and callback wiring for UI-driven workflows.
- TouchDesigner 2023+ (Python 3.11 environment)
- Veil Mail Python SDK installed into TouchDesigner's Python
- A Veil Mail account with an API key (
veil_live_xxxorveil_test_xxx)
Locate your TouchDesigner Python executable and install the veilmail package:
macOS:
/Applications/TouchDesigner.app/Contents/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install veilmailWindows:
"C:\Program Files\Derivative\TouchDesigner\bin\python.exe" -m pip install veilmailVerify the installation by opening a Text DAT in TouchDesigner and running:
import veilmail
print(veilmail.__version__)Copy these files into your TouchDesigner project folder (or add them to TD's Python search path):
veilmail_td.py-- Thin wrapper with threaded API callsVeilMailExt.py-- COMP extension classVeilMailCallbacks.py-- DAT execute callbacks (optional)VeilMailPars.json-- Parameter definitions reference
-
Create a Base COMP and name it
veilmail. -
Add a custom parameter page named
VeilMail. -
Create the following parameters on that page (see
VeilMailPars.jsonfor full definitions):Name Type Description Apikey Str Your Veil Mail API key Baseurl Str API base URL (default provided) From Str Sender email address To Str Recipient email address Subject Str Email subject line Body Str Email HTML body content Templateid Str Optional template ID Send Pulse Trigger email send Testconnection Pulse Test the API connection Refresh Pulse Re-initialize the client Status Str Last operation status (read-only) -
Attach the extension: In the COMP's Extensions parameter, add
VeilMailExt.pyand set the Extension Object toVeilMailExt. -
Place Python files (
veilmail_td.py,VeilMailExt.py) in your project folder or TouchDesigner's Python path. -
(Optional) Wire
VeilMailCallbacks.pyto a DAT Execute for button-driven interactions.
from veilmail_td import VeilMailTD
vm = VeilMailTD(api_key="veil_live_xxxxx")
# Non-blocking send (safe for cook thread)
vm.send_email(
from_addr="hello@yourdomain.com",
to="user@example.com",
subject="Hello from TouchDesigner!",
html="<h1>Sent from TD</h1>",
)Once you have the veilmail Base COMP set up with the extension:
- Fill in API Key, From, To, Subject, and Body parameters.
- Click the Send Email pulse button.
- Watch the Status parameter for confirmation or errors.
def on_success(key, result):
op('status_text').text = f"Done: {result}"
def on_error(key, error):
op('status_text').text = f"Error: {error}"
vm = VeilMailTD(
api_key="veil_live_xxxxx",
on_success=on_success,
on_error=on_error,
)
vm.send_email(
from_addr="hello@yourdomain.com",
to="user@example.com",
subject="Event triggered!",
html="<p>Something happened in the network.</p>",
)vm.send_email(
from_addr="hello@yourdomain.com",
to="user@example.com",
subject="Weekly Report",
template_id="tmpl_abc123",
template_data={"name": "Operator", "week": "2025-01"},
)| Method | Blocking | Description |
|---|---|---|
send_email() |
No | Send email on a background thread |
send_email_sync() |
Yes | Send email synchronously |
send_template_email() |
No | Send using a template (background) |
list_templates() |
No | Fetch templates (background) |
check_connection() |
No | Test API connectivity (background) |
| Method | Description |
|---|---|
SendEmail() |
Send email using COMP parameters |
TestConnection() |
Test API connection |
Refresh() |
Re-create the client |
TouchDesigner installations are operator-controlled environments. Direct API key usage in parameters and scripts is safe in this context, as the keys remain local to the machine running the TouchDesigner project. For shared projects, consider using environment variables or a separate configuration file that is excluded from version control.
| File | Purpose |
|---|---|
veilmail_td.py |
Thin wrapper with threaded API calls |
VeilMailExt.py |
COMP extension class |
VeilMailCallbacks.py |
DAT execute callback scripts |
VeilMailPars.json |
Parameter definitions for the component |
requirements.txt |
Python dependencies |
examples/ |
Example scripts |