This template provides the base structure for OTP emails. Dynamic variables like
website_name, name, and otp are replaced at runtime.
POST https://verifyone.bhanguz.com/api/v1/send-mail
| Variable | Type | Description |
|---|---|---|
website_name |
string | Name of the application, used throughout the email. |
name |
string | Full name of the user receiving the email. |
otp |
string | One-Time Password for verification. |
service_contact |
string | URL link to the contact/help page (used in footer). |
| Variable | Sample Value |
|---|---|
website_name |
VerifyOne |
name |
Prince |
otp |
184920 |
service_contact |
https://yourdomain.com/contact |
curl -X POST "https://verifyone.bhanguz.com/api/send-mail" \
-H "Content-Type: application/json" \
-d '{
"token": "YOUR_TOKEN",
"sid": "YOUR_SID",
"to": "user@example.com",
"website_name": "VerifyOne",
"name": "Prince",
"otp": "184920",
"service_contact": "https://yourdomain.com/contact"
}'
{
"token": "YOUR_TOKEN",
"sid": "YOUR_SID",
"to": "user@example.com",
"website_name": "VerifyOne",
"name": "Prince",
"otp": "184920",
"service_contact": "https://yourdomain.com/contact"
}
<?php
$data = [
"token" => "YOUR_TOKEN",
"sid" => "YOUR_SID",
"to" => "user@example.com",
"website_name" => "VerifyOne",
"name" => "Prince",
"otp" => "184920",
"service_contact" => "https://yourdomain.com/contact"
];
$ch = curl_init("https://verifyone.bhanguz.com/api/send-mail");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
const fetch = require('node-fetch');
const data = {
token: "YOUR_TOKEN",
sid: "YOUR_SID",
to: "user@example.com",
website_name: "VerifyOne",
name: "Prince",
otp: "184920",
service_contact: "https://yourdomain.com/contact"
};
fetch('https://verifyone.bhanguz.com/api/send-mail', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
})
.then(res => res.json())
.then(console.log)
.catch(console.error);
import requests
data = {
"token": "YOUR_TOKEN",
"sid": "YOUR_SID",
"to": "user@example.com",
"website_name": "VerifyOne",
"name": "Prince",
"otp": "184920",
"service_contact": "https://yourdomain.com/contact"
}
response = requests.post("https://verifyone.bhanguz.com/api/send-mail", json=data)
print(response.json())
using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
var data = new {
token = "YOUR_TOKEN",
sid = "YOUR_SID",
to = "user@example.com",
website_name = "VerifyOne",
name = "Prince",
otp = "184920",
service_contact = "https://yourdomain.com/contact"
};
var json = JsonSerializer.Serialize(data);
var response = await client.PostAsync("https://verifyone.bhanguz.com/api/send-mail",
new StringContent(json, Encoding.UTF8, "application/json"));
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
require 'net/http'
require 'json'
uri = URI('https://verifyone.bhanguz.com/api/send-mail')
data = {
token: "YOUR_TOKEN",
sid: "YOUR_SID",
to: "user@example.com",
website_name: "VerifyOne",
name: "Prince",
otp: "184920",
service_contact: "https://yourdomain.com/contact"
}
res = Net::HTTP.post(uri, data.to_json, "Content-Type" => "application/json")
puts res.body
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
data := map[string]string{
"token": "YOUR_TOKEN",
"sid": "YOUR_SID",
"to": "user@example.com",
"website_name": "VerifyOne",
"name": "Prince",
"otp": "184920",
"service_contact": "https://yourdomain.com/contact",
}
body, _ := json.Marshal(data)
resp, _ := http.Post("https://verifyone.bhanguz.com/api/send-mail", "application/json", bytes.NewBuffer(body))
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
Success Response:
{
"error": 0,
"message": "Email sent successfully"
}
Error Responses:
{
"error": 1,
"message": "SMTP configuration not found"
}
{
"error": 2,
"message": "Your plan is over, expired time"
}
{
"error": 3,
"message": "Your plan is over, message limit exceeded"
}
{
"error": 4,
"message": "Website not found"
}
{
"error": 5,
"message": "User not found"
}
data object when calling the API.otp is stored in both the notifications and
otp_logs tables.