Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Postbox
  • Getting started
    • All guides
    • Creating an address
    • Domain ownership check
    • Setting up a DMARC policy
    • Sending an email
    • Templating an email
    • Bulk emailing
    • Creating a configuration
    • Linking a configuration to an address
    • Limiting the list of senders
    • Writing logs
    • Viewing information about sent emails
  • Access management
  • Pricing policy
  • Metrics Monitoring
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Getting started
  • Sending an email via the AWS CLI
  1. Step-by-step guides
  2. Templating an email

Templating an email

Written by
Yandex Cloud
Updated at July 8, 2026
View in Markdown
  • Getting started
  • Sending an email via the AWS CLI

To send emails using a populated template, submit both the template and data to insert via the AWS CLI or API.

Getting startedGetting started

  1. Create a service account in the folder as the address. If you create the service account and address in different folders, you will get an error when attempting to send an email.
  2. Assign the postbox.sender role to the service account.
  3. Create a static access key. Save the ID and secret key to a secure location. You will not be able to view the secret key properties again after you close the window.
  4. Configure the AWS CLI.

Sending an email via the AWS CLISending an email via the AWS CLI

  1. Prepare an email template. For example, create a file named message.json with the following contents:

    {
       "FromEmailAddress": "Alice <alice@example.com>",
       "Destination": {
          "ToAddresses": [
             "bob@example.com",
             "Charlie <charlie@example.com>"
          ]
       },
       "Content": {
          "Template": {
             "Headers": [
                {
                   "Name": "List-Unsubscribe",
                   "Value": "<https://example.com/unsubscribe?user_id=sercet_hash>"
                },
                {
                   "Name": "List-Unsubscribe-Post",
                   "Value": "List-Unsubscribe=One-Click"
                }
             ],
             "TemplateContent": {
                "Subject": "Greetings, {{name}}!",
                "Text": "Dear {{name}},\r\nYour favorite animal is {{favoriteanimal}}.",
                "Html": "<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>"
             },
             "TemplateData": "{ \"name\":\"Bob\", \"favoriteanimal\": \"bobcat\" }"
          }
       },
       "ConfigurationSetName": "ConfigSet"
    }
    
  2. To send an email, run this command:

    aws sesv2 send-email --cli-input-json file://message.json \
      --endpoint-url https://postbox.cloud.yandex.net
    

    Note

    Template use the Handlebars syntax. When providing a template in a request, you can only use simple subsitutions. Loops, conditions, and other structures are not supported.

Was the article helpful?

Previous
Sending an email
Next
Bulk emailing
© 2026 Direct Cursus Technology L.L.C.