Let’s send your first email with TrackPost. This guide takes under 5 minutes from start to finish.
Table of Contents
Prerequisites
You’ll need:
- A TrackPost account (sign up here)
- An API key (we’ll get this in Step 1)
- A verified sender domain (we’ll use a test domain for now)
Tip
New to TrackPost? When you sign up, you get test keys that don’t require AWS SES setup. Perfect for this quick start!
Step 1: Get Your API Key
- Log in to your TrackPost Dashboard
- Navigate to API Keys in the sidebar
- Copy your test key (starts with
tp_test_)
Warning
Keep your API keys secure. Test keys can’t send real emails, but live keys should never be exposed in client-side code or public repositories.
Step 2: Send Your Email
Choose your preferred method:
- cURL
- CLI
- Node.js
Using cURL
Replace tp_test_your_api_key with your actual API key:
curl -X POST https://api.trackpost.de/v1/emails \
-H "Authorization: Bearer tp_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"to": "[email protected]",
"from": "[email protected]",
"subject": "Hello from TrackPost!",
"html": "<h1>It works!</h1><p>Your first TrackPost email.</p>",
"text": "It works! Your first TrackPost email."
}'
Expected Response:
{
"success": true,
"data": {
"id": "msg_abc123def456",
"to": "[email protected]",
"from": "[email protected]",
"subject": "Hello from TrackPost!",
"status": "sent",
"created_at": "2025-01-15T10:30:00Z"
}
}
Using the TrackPost CLI
Install the CLI (requires Node.js 18+):
npm install -g @trackpost/cli
Authenticate with your API key:
trackpost auth login
# Enter your API key when prompted
Send your email:
trackpost send \
--to [email protected] \
--from [email protected] \
--subject "Hello from TrackPost!" \
--html "<h1>It works!</h1><p>Your first TrackPost email.</p>"
Expected Output:
✓ Email queued successfully
ID: msg_abc123def456
To: [email protected]
Status: sent
Using Node.js SDK
Install the SDK:
npm install trackpost
Create a file send-email.js:
import { TrackPostClient } from 'trackpost';
const client = new TrackPostClient({
apiKey: 'tp_test_your_api_key'
});
async function sendEmail() {
try {
const response = await client.emails.send({
to: '[email protected]',
from: '[email protected]',
subject: 'Hello from TrackPost!',
html: '<h1>It works!</h1><p>Your first TrackPost email.</p>',
text: 'It works! Your first TrackPost email.'
});
console.log('Email sent!', response);
} catch (error) {
console.error('Error:', error.message);
}
}
sendEmail();
Run it:
node send-email.js
Step 3: Verify the Result
Check the Dashboard
- Go to your TrackPost Dashboard
- Click on Emails in the sidebar
- You should see your email in the list with status “sent”
View Email Details
Click on the email to see:
- Full content and metadata
- Delivery status
- Open/click tracking (if using live keys)
- Any errors or bounces
Info
Test Keys vs Live Keys: Test keys create email records in your dashboard but don’t actually deliver to recipients. This lets you test safely without sending real emails.
What You Can Do Now
Now that you’ve sent your first email:
1. Send to Multiple Recipients
{
"to": ["[email protected]", "[email protected]"],
"from": "[email protected]",
"subject": "Hello everyone!",
"html": "<h1>Welcome to our app!</h1>"
}
2. Add Attachments
{
"to": "[email protected]",
"from": "[email protected]",
"subject": "Your invoice",
"html": "<p>Please find your invoice attached.</p>",
"attachments": [
{
"filename": "invoice.pdf",
"content": "base64_encoded_content_here",
"contentType": "application/pdf"
}
]
}
3. Use Templates
Instead of inline HTML, use a template:
{
"to": "[email protected]",
"from": "[email protected]",
"template_id": "welcome_email",
"variables": {
"user_name": "John Doe",
"activation_link": "https://yourapp.com/activate?token=abc123"
}
}
See the Templates Guide for details.
Next Steps
Ready to go to production?
- Connect AWS SES - Set up your own AWS account for sending
- Verify Your Domain - Configure your sending domain
- Setup Live Keys - Generate production API keys
- Configure Webhooks - Get real-time delivery notifications
Troubleshooting
“Unauthorized” Error
Your API key is invalid or expired:
- Double-check you copied the entire key
- Verify you’re using the correct key (test vs live)
- Check that the key hasn’t been revoked in the dashboard
“Domain not verified” Error
You’re trying to send from a domain that isn’t verified:
- With test keys, you can use any “from” address for testing
- For production, you must verify your domain with AWS SES
- See Domain Setup
“Rate limit exceeded” Error
You’ve hit your plan’s rate limit:
- Free plan: 60 requests per minute
- Check your current usage in the dashboard
- Upgrade your plan or wait for the rate limit window to reset
Emails Not Showing in Dashboard
- Wait 10-15 seconds for the email to appear
- Check that you’re using the correct API key
- Verify the API endpoint (should be
api.trackpost.de)
Need more help? Check our Troubleshooting Guide or contact support.