A quick, practical guide to sending transactional emails with NotifiedBy. You’ll create a sender, generate an API key, and send your first email.
POST https://api.notifiedby.com/v1/email/send/Authorization: Api-Key YOUR_API_KEY
Good for quickly proving your sender + key works.
curl -X POST https://api.notifiedby.com/v1/email/send/ \
-H "Authorization: Api-Key YOUR_API_KEY" \
--data-urlencode "recipient=you@example.com" \
--data-urlencode "subject=Hello from NotifiedBy" \
--data-urlencode "body=<h1>Hello</h1><p>This is an HTML email.</p>" \
--data-urlencode "plain_body=Hello! This is the plain-text fallback."
Successful responses return JSON like {"id": "ABC123"}.
Python and Django are first-class here. Two additional examples are included below.
import os
import requests
API_KEY = os.environ["NOTIFIEDBY_API_KEY"]
resp = requests.post(
"https://api.notifiedby.com/v1/email/send/",
headers={"Authorization": f"Api-Key {API_KEY}"},
data={
"recipient": "you@example.com",
"subject": "Hello from Python",
"body": "<h1>Hello</h1><p>Sent via requests.</p>",
"plain_body": "Hello! Sent via requests.",
},
timeout=20,
)
print(resp.status_code)
print(resp.text)
NOTIFIEDBY_API_KEY.Option A: use the Django email backend integration.
# settings.py
import os
INSTALLED_APPS = [
# ...
"notifiedby",
]
EMAIL_BACKEND = "notifiedby.NotifiedByEmailBackend"
NOTIFIEDBY_API_KEY = os.environ["NOTIFIEDBY_API_KEY"]
# anywhere in your Django code
from django.core.mail import send_mail
send_mail(
subject="Password reset",
message="Plain text fallback",
from_email="from@ignored.com",
recipient_list=["user@example.com"],
html_message="<h1>Reset your password</h1><p>...</p>",
)
const API_KEY = process.env.NOTIFIEDBY_API_KEY;
const body = new URLSearchParams({
recipient: "you@example.com",
subject: "Hello from Node.js",
body: "<h1>Hello</h1><p>Sent via fetch.</p>",
plain_body: "Hello! Sent via fetch.",
});
const resp = await fetch("https://api.notifiedby.com/v1/email/send/", {
method: "POST",
headers: {
Authorization: `Api-Key ${API_KEY}`,
"Content-Type": "application/x-www-form-urlencoded",
},
body,
});
console.log(resp.status);
console.log(await resp.text());
require "uri"
require "net/http"
api_key = ENV.fetch("NOTIFIEDBY_API_KEY")
uri = URI("https://api.notifiedby.com/v1/email/send/")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Api-Key #{api_key}"
req.set_form_data({
"recipient" => "you@example.com",
"subject" => "Hello from Ruby",
"body" => "<h1>Hello</h1><p>Sent via Net::HTTP.</p>",
"plain_body" => "Hello! Sent via Net::HTTP.",
})
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(req)
end
puts resp.code
puts resp.body