Test
Send test email notifications (NBG)
Trigger transactional emails for NBG sandbox users via the same create-and-send path as production.
POST
/
test
/
email-notifications
Send test email notifications (NBG)
curl --request POST \
--url https://{host}/test/email-notifications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "email_account_verified",
"userId": "64f0c51e7fb3fc001234abcd",
"customData": {
"payment_url": "/"
}
}
'import requests
url = "https://{host}/test/email-notifications"
payload = {
"templateId": "email_account_verified",
"userId": "64f0c51e7fb3fc001234abcd",
"customData": { "payment_url": "/" }
}
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({
templateId: 'email_account_verified',
userId: '64f0c51e7fb3fc001234abcd',
customData: {payment_url: '/'}
})
};
fetch('https://{host}/test/email-notifications', 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://{host}/test/email-notifications",
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([
'templateId' => 'email_account_verified',
'userId' => '64f0c51e7fb3fc001234abcd',
'customData' => [
'payment_url' => '/'
]
]),
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://{host}/test/email-notifications"
payload := strings.NewReader("{\n \"templateId\": \"email_account_verified\",\n \"userId\": \"64f0c51e7fb3fc001234abcd\",\n \"customData\": {\n \"payment_url\": \"/\"\n }\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://{host}/test/email-notifications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"email_account_verified\",\n \"userId\": \"64f0c51e7fb3fc001234abcd\",\n \"customData\": {\n \"payment_url\": \"/\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/test/email-notifications")
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 \"templateId\": \"email_account_verified\",\n \"userId\": \"64f0c51e7fb3fc001234abcd\",\n \"customData\": {\n \"payment_url\": \"/\"\n }\n}"
response = http.request(request)
puts response.read_body{
"notificationId": "674a1b2c3d4e5f6789012345",
"status": "Sent"
}
These test endpoints are only available in development and staging environments. They are disabled in
production.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
NBG transactional email template_id sent to /v1/notifications/email/transactional.
Available options:
email_account_verified, email_monthly_investment, email_account_deletion_requested, email_account_deletion_completed, email_account_deletion_completed_inactive Example:
"email_account_verified"
MongoDB ObjectId of the NBG user to email.
Pattern:
^[a-f0-9]{24}$Example:
"64f0c51e7fb3fc001234abcd"
Optional key/value map sent to NBG as custom_data.
Show child attributes
Show child attributes
Example:
{ "payment_url": "/" }
⌘I
Send test email notifications (NBG)
curl --request POST \
--url https://{host}/test/email-notifications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "email_account_verified",
"userId": "64f0c51e7fb3fc001234abcd",
"customData": {
"payment_url": "/"
}
}
'import requests
url = "https://{host}/test/email-notifications"
payload = {
"templateId": "email_account_verified",
"userId": "64f0c51e7fb3fc001234abcd",
"customData": { "payment_url": "/" }
}
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({
templateId: 'email_account_verified',
userId: '64f0c51e7fb3fc001234abcd',
customData: {payment_url: '/'}
})
};
fetch('https://{host}/test/email-notifications', 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://{host}/test/email-notifications",
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([
'templateId' => 'email_account_verified',
'userId' => '64f0c51e7fb3fc001234abcd',
'customData' => [
'payment_url' => '/'
]
]),
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://{host}/test/email-notifications"
payload := strings.NewReader("{\n \"templateId\": \"email_account_verified\",\n \"userId\": \"64f0c51e7fb3fc001234abcd\",\n \"customData\": {\n \"payment_url\": \"/\"\n }\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://{host}/test/email-notifications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"email_account_verified\",\n \"userId\": \"64f0c51e7fb3fc001234abcd\",\n \"customData\": {\n \"payment_url\": \"/\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/test/email-notifications")
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 \"templateId\": \"email_account_verified\",\n \"userId\": \"64f0c51e7fb3fc001234abcd\",\n \"customData\": {\n \"payment_url\": \"/\"\n }\n}"
response = http.request(request)
puts response.read_body{
"notificationId": "674a1b2c3d4e5f6789012345",
"status": "Sent"
}