Send an email to one of more registered contacts.
curl --request POST \
--url https://api.indiepitcher.com/v1/email/contact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "Welcome to IndiePitcher {{firstName}}!",
"body": "Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.",
"list": "important",
"contactEmail": "john@acme.com",
"contactEmails": null,
"delaySeconds": null,
"delayUntilDate": "2023-11-07T05:31:56Z",
"trackEmailOpens": null,
"trackEmailLinkClicks": null
}
'import requests
url = "https://api.indiepitcher.com/v1/email/contact"
payload = {
"subject": "Welcome to IndiePitcher {{firstName}}!",
"body": "Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.",
"list": "important",
"contactEmail": "john@acme.com",
"contactEmails": None,
"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: 'Welcome to IndiePitcher {{firstName}}!',
body: JSON.stringify('Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.'),
list: 'important',
contactEmail: 'john@acme.com',
contactEmails: null,
delaySeconds: null,
delayUntilDate: '2023-11-07T05:31:56Z',
trackEmailOpens: null,
trackEmailLinkClicks: null
})
};
fetch('https://api.indiepitcher.com/v1/email/contact', 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/contact",
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' => 'Welcome to IndiePitcher {{firstName}}!',
'body' => 'Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.',
'list' => 'important',
'contactEmail' => 'john@acme.com',
'contactEmails' => null,
'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/contact"
payload := strings.NewReader("{\n \"subject\": \"Welcome to IndiePitcher {{firstName}}!\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"contactEmail\": \"john@acme.com\",\n \"contactEmails\": null,\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/contact")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"Welcome to IndiePitcher {{firstName}}!\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"contactEmail\": \"john@acme.com\",\n \"contactEmails\": null,\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/contact")
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\": \"Welcome to IndiePitcher {{firstName}}!\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"contactEmail\": \"john@acme.com\",\n \"contactEmails\": null,\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
}Email
Send an email to one of more registered contacts.
Send a personalized email to one more (up to 100 using 1 API call) contacts subscribed to a proviced mailing list. This is the recommended way to send an email to members of a team of your product. All provided emails must belong to your mailing list and must be members of provided mailing list. 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.
POST
/
email
/
contact
Send an email to one of more registered contacts.
curl --request POST \
--url https://api.indiepitcher.com/v1/email/contact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "Welcome to IndiePitcher {{firstName}}!",
"body": "Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.",
"list": "important",
"contactEmail": "john@acme.com",
"contactEmails": null,
"delaySeconds": null,
"delayUntilDate": "2023-11-07T05:31:56Z",
"trackEmailOpens": null,
"trackEmailLinkClicks": null
}
'import requests
url = "https://api.indiepitcher.com/v1/email/contact"
payload = {
"subject": "Welcome to IndiePitcher {{firstName}}!",
"body": "Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.",
"list": "important",
"contactEmail": "john@acme.com",
"contactEmails": None,
"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: 'Welcome to IndiePitcher {{firstName}}!',
body: JSON.stringify('Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.'),
list: 'important',
contactEmail: 'john@acme.com',
contactEmails: null,
delaySeconds: null,
delayUntilDate: '2023-11-07T05:31:56Z',
trackEmailOpens: null,
trackEmailLinkClicks: null
})
};
fetch('https://api.indiepitcher.com/v1/email/contact', 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/contact",
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' => 'Welcome to IndiePitcher {{firstName}}!',
'body' => 'Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.',
'list' => 'important',
'contactEmail' => 'john@acme.com',
'contactEmails' => null,
'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/contact"
payload := strings.NewReader("{\n \"subject\": \"Welcome to IndiePitcher {{firstName}}!\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"contactEmail\": \"john@acme.com\",\n \"contactEmails\": null,\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/contact")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"Welcome to IndiePitcher {{firstName}}!\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"contactEmail\": \"john@acme.com\",\n \"contactEmails\": null,\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/contact")
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\": \"Welcome to IndiePitcher {{firstName}}!\",\n \"body\": \"Hi {{firstName}}, You can use **markdown** to generate the email. Plain HTML is also supported.\",\n \"list\": \"important\",\n \"contactEmail\": \"john@acme.com\",\n \"contactEmails\": null,\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
Body
application/json
