Encharge Developers
  • Developer Documentation
  • Getting Started
    • Sending data to your Encharge account
      • Ingest API
      • JavaScript Event Tracking
      • Segment.com Integration
    • Getting Help
  • Sending Emails
    • Personalizing Emails with Liquid
    • Email Deliverability
  • Encharge API
  • API Documentation
  • Transactional Email API
    • Overview
      • Pricing
    • Benefits and Features
    • Technical Overview
    • Send an email from template
    • Send custom HTML email
    • Send a plain-text email
    • Authentication
    • Reference
    • Sending to unsubscribed contacts
  • Advanced
    • Activity Stream
Powered by GitBook
On this page

Was this helpful?

  1. Transactional Email API

Send a plain-text email

PreviousSend custom HTML emailNextAuthentication

Last updated 4 years ago

Was this helpful?

To send a plain-text email (i.e. one that appears to be sent manually) via the Encharge Transactional Email API, specify the text parameter. You'll also need to provide the email subject as subject and the sender email as from

If you have previously created the recipient in Encharge, you can use personalization tags, for example {{ person.firstName }} in your email's text. See what fields you can use in .

const axios = require('axios');

// Send a POST request
axios({
  method: 'post',
  url: 'https://api.encharge.io/v1/emails/send?token=yourAPIKey',
  data: {
    "to": "recipient@example.com",
    "from": "sender@acme.org",
    "subject": "Welcome",
    "text": "Hello and welcome, {{ person.firstName }}!",
    /**
   * Optionally, you can include a dictionary of fields to be replaced.
   * For example, passing
   * `{ "loginURL": "https://app.encharge.io/login/3n2l3ad99"}`
   * will replace
   * `{{ loginURL }}` in the email text or subject.
   */
    "templateProperties": {
      "loginURL": "https://app.encharge.io/login/3n2l3ad99"
    }
  }
});
Person Fields