The Transactional SMS Object represents a transactional SMS template in your Go-Mailer account. The API allows you to send or dispatch SMS messages to your users.
Sends the specified transactional SMS to the specified recipients. A recipient does not have to be a contact in your account.
The SMS template's unique code.
The phone number of the recipient. Format should be 234xxxxxxxxx
A key => value set of information which will be used to replace any placeholders specified in the transactional SMS.
The key should be the name of the placeholder used. e.g: if you used @firstname placeholder in your template, then your data object should look like this { firstname: "Sample Name" }
const response = await fetch("https://api.go-mailer.com/v1/sms", {
method: "POST",
headers: {
Authorization: "Bearer <API_KEY>"
},
body: JSON.stringify({
code: "BIRTHDAY_SMS",
to: "234xxxxxxxxx",
context: {
firstname: "John",
age: 47,
}
})
});