Home/Tools/@tpmjs/tools-postmark

sendEmailWithTemplate

@tpmjs/tools-postmark

Send an email using a Postmark template.

Official
ops
v0.2.1
MIT

Interactive Playground

Test @tpmjs/tools-postmark (sendEmailWithTemplate) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-postmark
pnpm add @tpmjs/tools-postmark
yarn add @tpmjs/tools-postmark
bun add @tpmjs/tools-postmark
deno add npm:@tpmjs/tools-postmark

2. Import the tool

import { sendEmailWithTemplate } from '@tpmjs/tools-postmark';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { sendEmailWithTemplate } from '@tpmjs/tools-postmark';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { sendEmailWithTemplate },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Signature

(To: string, From: string, TemplateModel: Record<string, unknown>, Cc?: string, Bcc?: string, Tag?: string, Headers?: { Name: string; Value: string }[], ReplyTo?: string, Metadata?: Record<string, unknown>, InlineCss?: boolean, TemplateId?: number, TrackLinks?: string, TrackOpens?: boolean, Attachments?: { Name: string; Content: string; ContentID: string; ContentType: string }[], MessageStream?: string, TemplateAlias?: string) => Promise<unknown>

Tags

agent
email
ops
postmark
send
smtp
template
tpmjs
transactional

Parameters

Available configuration options

Auto-extracted
TemplateId
Optional
Type: number

Numeric template ID.

TemplateAlias
Optional
Type: string

Template alias string.

TemplateModel
Required
Type: object

Template variable values.

From
Required
Type: string

Sender email address.

To
Required
Type: string

Recipient email address(es).

Cc
Optional
Type: string

CC recipients.

Bcc
Optional
Type: string

BCC recipients.

Tag
Optional
Type: string

Tag for categorizing.

ReplyTo
Optional
Type: string

Reply-to address.

Metadata
Optional
Type: object

Metadata key-value pairs.

Headers
Optional
Type: array

Attachments
Optional
Type: array

TrackOpens
Optional
Type: boolean

TrackLinks
Optional
Type: string

MessageStream
Optional
Type: string

InlineCss
Optional
Type: boolean

Inline CSS in the HTML body.

Schema extracted: 3/1/2026, 4:28:04 AM

README

ERROR: No README data found!

Statistics

Downloads/month

178

GitHub Stars

14

Quality Score

89%

Bundle Size

NPM Keywords

tpmjs
postmark
email
transactional
smtp
agent

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai