Send a plain-text email
const axios = require('axios');
// Send a POST request
axios({
method: 'post',
url: 'https://api.encharge.io/v1/emails/send?token=yourAPIKey',
data: {
"to": "[email protected]",
"from": "[email protected]",
"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"
}
}
});Last updated