curl --request POST \
--url https://api.indiepitcher.com/v1/email/list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "IndiePitcher monthly news for {{firstName}}",
"body": "Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.",
"list": "important",
"delaySeconds": null,
"delayUntilDate": "2023-11-07T05:31:56Z",
"trackEmailOpens": null,
"trackEmailLinkClicks": null
}
'import requests
url = "https://api.indiepitcher.com/v1/email/list"
payload = {
"subject": "IndiePitcher monthly news for {{firstName}}",
"body": "Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.",
"list": "important",
"delaySeconds": None,
"delayUntilDate": "2023-11-07T05:31:56Z",
"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: 'IndiePitcher monthly news for {{firstName}}',
body: JSON.stringify('Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.'),
list: 'important',
delaySeconds: null,
delayUntilDate: '2023-11-07T05:31:56Z',
trackEmailOpens: null,
trackEmailLinkClicks: null
})
};
fetch('https://api.indiepitcher.com/v1/email/list', 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/list",
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' => 'IndiePitcher monthly news for {{firstName}}',
'body' => 'Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.',
'list' => 'important',
'delaySeconds' => null,
'delayUntilDate' => '2023-11-07T05:31:56Z',
'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/list"
payload := strings.NewReader("{\n \"subject\": \"IndiePitcher monthly news for {{firstName}}\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"delaySeconds\": null,\n \"delayUntilDate\": \"2023-11-07T05:31:56Z\",\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/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"IndiePitcher monthly news for {{firstName}}\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"delaySeconds\": null,\n \"delayUntilDate\": \"2023-11-07T05:31:56Z\",\n \"trackEmailOpens\": null,\n \"trackEmailLinkClicks\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indiepitcher.com/v1/email/list")
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\": \"IndiePitcher monthly news for {{firstName}}\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"delaySeconds\": null,\n \"delayUntilDate\": \"2023-11-07T05:31:56Z\",\n \"trackEmailOpens\": null,\n \"trackEmailLinkClicks\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Send an email to registered contacts in a mailing list.
This is the recommendat way to send a newsletter, by creating a list called something like Newsletter. All contacts are automatically subscribed to important default mailing list. You can use peronalization tags such as Hi {{firstName}} to peronalize individual sent emails, and scheduled it to be sent with a delay.
curl --request POST \
--url https://api.indiepitcher.com/v1/email/list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "IndiePitcher monthly news for {{firstName}}",
"body": "Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.",
"list": "important",
"delaySeconds": null,
"delayUntilDate": "2023-11-07T05:31:56Z",
"trackEmailOpens": null,
"trackEmailLinkClicks": null
}
'import requests
url = "https://api.indiepitcher.com/v1/email/list"
payload = {
"subject": "IndiePitcher monthly news for {{firstName}}",
"body": "Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.",
"list": "important",
"delaySeconds": None,
"delayUntilDate": "2023-11-07T05:31:56Z",
"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: 'IndiePitcher monthly news for {{firstName}}',
body: JSON.stringify('Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.'),
list: 'important',
delaySeconds: null,
delayUntilDate: '2023-11-07T05:31:56Z',
trackEmailOpens: null,
trackEmailLinkClicks: null
})
};
fetch('https://api.indiepitcher.com/v1/email/list', 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/list",
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' => 'IndiePitcher monthly news for {{firstName}}',
'body' => 'Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.',
'list' => 'important',
'delaySeconds' => null,
'delayUntilDate' => '2023-11-07T05:31:56Z',
'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/list"
payload := strings.NewReader("{\n \"subject\": \"IndiePitcher monthly news for {{firstName}}\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"delaySeconds\": null,\n \"delayUntilDate\": \"2023-11-07T05:31:56Z\",\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/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"IndiePitcher monthly news for {{firstName}}\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"delaySeconds\": null,\n \"delayUntilDate\": \"2023-11-07T05:31:56Z\",\n \"trackEmailOpens\": null,\n \"trackEmailLinkClicks\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indiepitcher.com/v1/email/list")
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\": \"IndiePitcher monthly news for {{firstName}}\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"delaySeconds\": null,\n \"delayUntilDate\": \"2023-11-07T05:31:56Z\",\n \"trackEmailOpens\": null,\n \"trackEmailLinkClicks\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The subject of the email. Supports personalization.
"IndiePitcher monthly news for {{firstName}}"
The body of the email. Both HTML and markdown body do support personalization.
"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported."
The format of the email body. It can be either 'markdown' or 'html'.
markdown, html Specify a list the contact(s) can unsubscribe from if they don't wish to receive further emails like this. The contact(s) must be subscribed to this list. Pass 'important' to provide a list the contact(s) cannot unsubscribe from.
"important"
Delay sending of this email by the amount of seconds you provide.
null
Delay sending of this email until specified date.
Whether to track email opens. Allow you to overwrite the project's global setting. Default: nil - Uses the project's global setting.
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.
null
Response
An empty response
Always true
