SendTemplateEmailOptions

Properties

NameType
tostring

One recipient email address.

distinctIdstring

The recipient's distinct ID in your product. The email's events go to this person. Without it, they go to a person whose distinct ID is the email address.

idempotencyKeystring

1 to 255 visible ASCII characters. A send with a key that PostHog has already accepted queues nothing and returns the first send's result. The same key with other options sends nothing and returns an error with code idempotency_key_reused. Without it, the client makes a UUID that covers its own retries. Pass a key derived from what the email is for, such as welcome:user_123, to cover retries outside this call too.

maxRetriesnumber

Overrides the client's emailRequestMaxRetries for this send. 0 turns retries off.

templateIdstring

The UUID of an email template made transactional in PostHog.

templateDataRecord<string, unknown>

Values for the template's {{ variables.* }} placeholders. Sent as message_data.

templateKeynever

Names the email, such as 'password-reset', so its metrics, logs and status group under it in PostHog. Letters, digits, hyphens and underscores, at most 400.

subjectnever
fromnever

A verified sender, such as 'Acme <security@example.com>'. Without it, the project's default sender.

replyTonever
captureEngagementnever

Whether PostHog captures the email's engagement events (sent, delivered, opened, clicked, bounced) as events of the recipient. Defaults to true. A project whose admin turned engagement capture off captures nothing, whatever the send asks. A template made in PostHog follows the project's setting.

htmlnever
textnever