Skip to main content
POST
/
email
/
transactional
Sends an email to specified email address.
curl --request POST \
  --url https://api.indiepitcher.com/v1/email/transactional \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "subject": "You've been invited to IndiePitcher",
  "body": "You can use **markdown** to generate the email. Plain HTML is also supported.",
  "to": "john@acme.com",
  "trackEmailOpens": null,
  "trackEmailLinkClicks": null
}
EOF
import requests

url = "https://api.indiepitcher.com/v1/email/transactional"

payload = {
"subject": "You've been invited to IndiePitcher",
"body": "You can use **markdown** to generate the email. Plain HTML is also supported.",
"to": "john@acme.com",
"trackEmailOpens": None,
"trackEmailLinkClicks": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: 'You\'ve been invited to IndiePitcher',
body: JSON.stringify('You can use **markdown** to generate the email. Plain HTML is also supported.'),
to: 'john@acme.com',
trackEmailOpens: null,
trackEmailLinkClicks: null
})
};

fetch('https://api.indiepitcher.com/v1/email/transactional', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.indiepitcher.com/v1/email/transactional",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => 'You\'ve been invited to IndiePitcher',
'body' => 'You can use **markdown** to generate the email. Plain HTML is also supported.',
'to' => 'john@acme.com',
'trackEmailOpens' => null,
'trackEmailLinkClicks' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.indiepitcher.com/v1/email/transactional"

payload := strings.NewReader("{\n \"subject\": \"You've been invited to IndiePitcher\",\n \"body\": \"You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"to\": \"john@acme.com\",\n \"trackEmailOpens\": null,\n \"trackEmailLinkClicks\": null\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.indiepitcher.com/v1/email/transactional")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"You've been invited to IndiePitcher\",\n \"body\": \"You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"to\": \"john@acme.com\",\n \"trackEmailOpens\": null,\n \"trackEmailLinkClicks\": null\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.indiepitcher.com/v1/email/transactional")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"You've been invited to IndiePitcher\",\n \"body\": \"You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"to\": \"john@acme.com\",\n \"trackEmailOpens\": null,\n \"trackEmailLinkClicks\": null\n}"

response = http.request(request)
puts response.read_body
{
  "success": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
subject
string
required

The subject of the email.

Example:

"You've been invited to IndiePitcher"

body
string
required

The body of the email. Supports markdown and HTML

Example:

"You can use **markdown** to generate the email. Plain HTML is also supported."

bodyFormat
enum<string>
required

The format of the email body. It can be either 'markdown' or 'html'.

Available options:
markdown,
html
to
string

Can be just an email "john@example.com", or an email with a neme "John Doe john@example.com"

Example:

"john@acme.com"

trackEmailOpens
boolean

Whether to track email opens. Allow you to overwrite the project's global setting. Default: nil - Uses the project's global setting.

Example:

null

Whether to track when a users taps on a link in the email. Allow you to overwrite the project's global setting. Default: nil - Uses the project's global setting.

Example:

null

Response

200 - application/json

An empty response

success
boolean

Always true