Ruby
Helo.configure do |config|
config.api_key = ENV.fetch("HELO_API_KEY")
end
send_message_batch_request = Helo::SendMessageBatchRequest.new(
requests: [Helo::SendMessageRequest.new(to: [], cc: [], bcc: [], reply_to: [], subject: "test-subject", html: "test-html", text: "test-text", template: {}, tracking: {}, attachments: [], tags: ["example1", "example2"], headers: {}, metadata: {})]
)
Helo::Sending.transactional_batch(send_message_batch_request, channel_id: "550e8400-e29b-41d4-a716-446655440000", idempotency_key: "example")import Helo from "@helo-email/sdk";
const apiKey = process.env.HELO_API_KEY;
const helo = new Helo(apiKey);
const result = await helo.sending.transactionalBatch(
{
requests: [
{
from: { email: "test@example.com", name: "test-name" },
to: [{ email: "test@example.com", name: "test-name" }],
cc: [{ email: "test@example.com", name: "test-name" }],
bcc: [{ email: "test@example.com", name: "test-name" }],
replyTo: [{ email: "test@example.com", name: "test-name" }],
subject: "test-subject",
html: "test-html",
text: "test-text",
template: {
subject: "test-subject",
html: "test-html",
text: "test-text",
inlineStyles: true,
data: {},
},
tracking: { opens: true, links: true },
attachments: [
{
content: "test-content",
contentId: "test-contentId",
contentType: "test-contentType",
fileName: "test-fileName",
disposition: Helo.AttachmentDisposition.ATTACHMENT,
},
],
tags: ["example1", "example2"],
headers: {},
metadata: {},
},
],
},
{
channelId: "550e8400-e29b-41d4-a716-446655440000",
idempotencyKey: "example",
},
);package main
import (
"context"
"log"
"os"
"github.com/helo-email/helo-sdk-go"
)
func main() {
client := helo.NewHelo(os.Getenv("HELO_API_KEY"))
ctx := context.Background()
params := &helo.SendMessageBatchRequest{
Requests: []helo.SendMessageRequest{{From: helo.MailAddress{Email: "test@example.com", Name: "test-name"}, To: []helo.MailAddress{{Email: "test@example.com", Name: "test-name"}}, Subject: "test-subject", Html: "test-html", Text: "test-text", Tags: []string{"example1", "example2"}}},
}
opts := &helo.SendingTransactionalBatchOptions{
ChannelID: "550e8400-e29b-41d4-a716-446655440000",
IdempotencyKey: "example",
}
result, err := client.Sending.TransactionalBatch(ctx, params, opts)
if err != nil {
log.Fatal(err)
}
_ = result
}using HeloEmail.Sdk;
using HeloEmail.Sdk.Sending;
var response = await helo.Sending.TransactionalBatch(new SendMessageBatchRequest
{
Requests =
[
new SendMessageRequest
{
From = new MailAddress { Email = "from@yourdomain.com", Name = "From name" },
To = [new MailAddress { Email = "first@example.com" }],
Subject = "Hello from Helo",
Html = "<html><body><h1>Hi there, new friend.</h1><p>This is a test message, delivered with <3 by Helo. </p></body></html>",
},
new SendMessageRequest
{
From = new MailAddress { Email = "from@yourdomain.com", Name = "From name" },
To = [new MailAddress { Email = "second@example.com" }],
Subject = "Hello from Helo",
Html = "<html><body><h1>Hi there, new friend.</h1><p>This is a test message, delivered with <3 by Helo. </p></body></html>",
},
],
}, channelId: "your-channel-id");import sdk_helo_email as helo
client = helo.Helo() # reads HELO_API_KEY from the environment
response = client.sending.transactional_batch(
requests=[
{
"from": {"email": "from@yourdomain.com", "name": "From name"},
"to": [{"email": "first@example.com"}],
"subject": "Hello from Helo",
"html": "<html><body><h1>Hi there, new friend.</h1><p>This is a test message, delivered with <3 by Helo. </p></body></html>",
"text": "This is a test message, delivered with <3 by Helo."
},
{
"from": {"email": "from@yourdomain.com", "name": "From name"},
"to": [{"email": "second@example.com"}],
"subject": "Hello from Helo",
"html": "<html><body><h1>Hi there, new friend.</h1><p>This is a test message, delivered with <3 by Helo. </p></body></html>",
"text": "This is a test message, delivered with <3 by Helo."
}
],
channel_id="your-channel-id",
){
"responses": [
{
"status": "<string>",
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suppressions": [
"<string>"
]
}
]
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}Sending
Send transactional emails in batch
Sends multiple transactional emails in a single API request for better performance.
POST
/
send
/
transactional
/
batch
Ruby
Helo.configure do |config|
config.api_key = ENV.fetch("HELO_API_KEY")
end
send_message_batch_request = Helo::SendMessageBatchRequest.new(
requests: [Helo::SendMessageRequest.new(to: [], cc: [], bcc: [], reply_to: [], subject: "test-subject", html: "test-html", text: "test-text", template: {}, tracking: {}, attachments: [], tags: ["example1", "example2"], headers: {}, metadata: {})]
)
Helo::Sending.transactional_batch(send_message_batch_request, channel_id: "550e8400-e29b-41d4-a716-446655440000", idempotency_key: "example")import Helo from "@helo-email/sdk";
const apiKey = process.env.HELO_API_KEY;
const helo = new Helo(apiKey);
const result = await helo.sending.transactionalBatch(
{
requests: [
{
from: { email: "test@example.com", name: "test-name" },
to: [{ email: "test@example.com", name: "test-name" }],
cc: [{ email: "test@example.com", name: "test-name" }],
bcc: [{ email: "test@example.com", name: "test-name" }],
replyTo: [{ email: "test@example.com", name: "test-name" }],
subject: "test-subject",
html: "test-html",
text: "test-text",
template: {
subject: "test-subject",
html: "test-html",
text: "test-text",
inlineStyles: true,
data: {},
},
tracking: { opens: true, links: true },
attachments: [
{
content: "test-content",
contentId: "test-contentId",
contentType: "test-contentType",
fileName: "test-fileName",
disposition: Helo.AttachmentDisposition.ATTACHMENT,
},
],
tags: ["example1", "example2"],
headers: {},
metadata: {},
},
],
},
{
channelId: "550e8400-e29b-41d4-a716-446655440000",
idempotencyKey: "example",
},
);package main
import (
"context"
"log"
"os"
"github.com/helo-email/helo-sdk-go"
)
func main() {
client := helo.NewHelo(os.Getenv("HELO_API_KEY"))
ctx := context.Background()
params := &helo.SendMessageBatchRequest{
Requests: []helo.SendMessageRequest{{From: helo.MailAddress{Email: "test@example.com", Name: "test-name"}, To: []helo.MailAddress{{Email: "test@example.com", Name: "test-name"}}, Subject: "test-subject", Html: "test-html", Text: "test-text", Tags: []string{"example1", "example2"}}},
}
opts := &helo.SendingTransactionalBatchOptions{
ChannelID: "550e8400-e29b-41d4-a716-446655440000",
IdempotencyKey: "example",
}
result, err := client.Sending.TransactionalBatch(ctx, params, opts)
if err != nil {
log.Fatal(err)
}
_ = result
}using HeloEmail.Sdk;
using HeloEmail.Sdk.Sending;
var response = await helo.Sending.TransactionalBatch(new SendMessageBatchRequest
{
Requests =
[
new SendMessageRequest
{
From = new MailAddress { Email = "from@yourdomain.com", Name = "From name" },
To = [new MailAddress { Email = "first@example.com" }],
Subject = "Hello from Helo",
Html = "<html><body><h1>Hi there, new friend.</h1><p>This is a test message, delivered with <3 by Helo. </p></body></html>",
},
new SendMessageRequest
{
From = new MailAddress { Email = "from@yourdomain.com", Name = "From name" },
To = [new MailAddress { Email = "second@example.com" }],
Subject = "Hello from Helo",
Html = "<html><body><h1>Hi there, new friend.</h1><p>This is a test message, delivered with <3 by Helo. </p></body></html>",
},
],
}, channelId: "your-channel-id");import sdk_helo_email as helo
client = helo.Helo() # reads HELO_API_KEY from the environment
response = client.sending.transactional_batch(
requests=[
{
"from": {"email": "from@yourdomain.com", "name": "From name"},
"to": [{"email": "first@example.com"}],
"subject": "Hello from Helo",
"html": "<html><body><h1>Hi there, new friend.</h1><p>This is a test message, delivered with <3 by Helo. </p></body></html>",
"text": "This is a test message, delivered with <3 by Helo."
},
{
"from": {"email": "from@yourdomain.com", "name": "From name"},
"to": [{"email": "second@example.com"}],
"subject": "Hello from Helo",
"html": "<html><body><h1>Hi there, new friend.</h1><p>This is a test message, delivered with <3 by Helo. </p></body></html>",
"text": "This is a test message, delivered with <3 by Helo."
}
],
channel_id="your-channel-id",
){
"responses": [
{
"status": "<string>",
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suppressions": [
"<string>"
]
}
]
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Used to specify a channel ID for sending when using an account-level API credential.
A unique identifier used to prevent duplicate messages being sent when retrying failed requests.
Maximum string length:
256Body
application/json
Show child attributes
Show child attributes
Response
OK
- Option 1
- Option 2
Show child attributes
Show child attributes
⌘I