Email API

Send templated emails with VoiceStamp integrations and dynamic content

📧 19 Available Templates: Including VoiceStamp Share (#100), Verification Code (#2), Welcome Email (#1), and more.→ View all templates

Email System Features

The Email API enables you to:

  • Send templated emails with dynamic variables
  • Share VoiceStamps via email with custom messages
  • Use short codes for personalized content
  • Track email delivery and engagement
  • Manage templates with the admin interface

Base URL

https://voicestamp.vps.webdock.cloud/api/v1/email

Send Email

Send an email using a predefined template with dynamic variables.

POST /api/v1/email/send

Request Body

{
  "template_id": "9",
  "recipient_email": "user@example.com",
  "recipient_name": "John Doe",
  "variables": {
    "sender_name": "Your Name",
    "voicestamp_url": "https://voicestamp.app/listen/vst_123",
    "message": "Check out this voice recording!",
    "custom_note": "Added from mobile app"
  }
}

Parameters

ParameterTypeRequiredDescription
template_idstringNo*ID of the email template (use either template_id or template_name)
template_namestringNo*Name of the email template (use either template_id or template_name)
recipient_emailstringYesEmail address of the recipient
recipient_namestringNoDisplay name of the recipient
variablesobjectNoKey-value pairs for template variables

* Either template_id or template_name must be provided

Template Management

Get All Templates

GET /api/v1/email/templates

Retrieve a list of all active email templates.

Get Single Template

GET /api/v1/email/templates/{id}

Get details of a specific email template by ID.

Create Template

POST /api/v1/email/templates
{
  "name": "Welcome Email",
  "subject": "Welcome to VoiceStamp, {{first_name}}!",
  "html_content": "<h1>Welcome {{first_name}}!</h1><p>Thank you for joining VoiceStamp.</p>",
  "plain_content": "Welcome {{first_name}}! Thank you for joining VoiceStamp.",
  "short_codes_used": ["first_name", "email"],
  "category": "onboarding"
}

Update Template

PUT /api/v1/email/templates/{id}

Update any field of an existing template. All fields are optional.

Delete Template

DELETE /api/v1/email/templates/{id}

Soft delete a template (sets is_active to false).

Get Short Codes

Retrieve all available short codes for use in email templates.

GET /api/v1/email/short-codes

Returns a list of all short codes organized by category that can be used in email templates.

Common Template Variables

Standard variables available in VoiceStamp email templates.

VariableDescriptionExample
sender_nameName of the person sending the VoiceStampJohn Smith
recipient_nameName of the person receiving the emailSarah Johnson
voicestamp_urlDirect link to listen to the VoiceStamphttps://voicestamp.app/listen/vst_123
messageCustom message from the senderCheck out this voice note!
share_codeUnique code for accessing shared contentABC123

Example: Share VoiceStamp via Email

Complete example of sharing a voice recording via email.

// JavaScript Example
const shareVoiceStamp = async (voiceStampId, recipientEmail) => {
  // First, get the VoiceStamp details
  const vstResponse = await fetch(`/api/v1/voicestamps/${voiceStampId}`, {
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN_HERE',
      'Content-Type': 'application/json'
    }
  });
  
  const voiceStamp = await vstResponse.json();
  
  // Then send the email
  const emailResponse = await fetch('/api/v1/email/send', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN_HERE',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      template_id: '9',
      recipient_email: recipientEmail,
      recipient_name: 'Friend',
      variables: {
        sender_name: 'Your Name',
        voicestamp_url: voiceStamp.data.public_url,
        message: 'I recorded this voice note for you!',
        share_code: voiceStamp.data.share_code
      }
    })
  });
  
  return emailResponse.json();
};
Email API - VoiceStamp API Documentation