Guide: how to send an order confirmation email
Description
This guide will show you the algorithm for working in the Altcraft Platform market.
Let's imagine that we have an online store for smartphones. A buyer visits a website, adds the product to the cart and places the order. Our task is to send them an order confirmation email with the order number and price.
The guide comprises the following steps:
- Creating a sales channel and touchpoins
- Importing product and SKU data using a yml file
- Setting up an API request to add order data to the market
- Creating a template and substituting order data using variables
- Setting up a trigger mailing
Step 1. Set up a sales channel
You need a sales channel to start working in the market. This channel defines a profile database and touchpoints.
A profile database contains the contact details of customers who place orders in a certain channel. You need to import their data into a new or existing database. To do this, use import from a file or via API.
A touchpoint is a platform or a tool using which you sell products and services to your customers (a website, a store, a parcel terminal, a social network, a call center and so on). A touchpoint connects a sales channel a an order.
To create a channel, go to Market —> Settings in the main menu. Create a new channel on the Sales channels tab. Specify:
- a channel name
- an additional identifier
- a profile database
- a channel type: online or retail
Next, save the channel and go back to its settings. Create touchpoints.
Please note that each touchpoint can only be linked to one channel. The touchpoint ID will be used in the API request to import the order.

Step 2. Upload product data to the platform
Products in the market are represented by two entities: products and SKU.
A product is goods or services for sale. SKU is a product modifier, it is used for variations of one product (such characteristics as colour, size, weight, model, configuration and so on can vary).
SKU is connected to a certain product and cannot exist without it. For example, Apple iPhone 12 is a product, but Apple iPhone 12 128GB and Apple iPhone 12 256GB are its SKUs.
There are three ways to add product data to the platform:
Let's import product data from a file. To do this, you need a yml file.
If you have any questions about import, read this detailed guide.
Below you can see examples of yml files:
Product
A file with such content will add two products to the market: Apple iPhone 12 and Xiaomi 12X.
<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="2017-02-05 17:22">
<shop>
<name>BestSeller</name>
<company>Tne Best inc.</company>
<url>http://best.seller.ru</url>
<categories>
<category id="10">Смартфоны</category>
<category id="101" parentId="10">Apple</category>
<category id="102" parentId="10">Xiaomi</category>
</categories>
<offers>
<offer id="iphone12" available="true">
<name>Apple iPhone 12</name>
<vendor>Apple</vendor>
<url>http://best.seller.ru/product_page.asp?pid=12348</url>
<price>83990</price>
<oldprice>89990</oldprice>
<currencyId>RUB</currencyId>
<categoryId>101</categoryId>
<picture>https://example.com/img/apple_phone.png</picture>
<delivery>true</delivery>
<manufacturer_warranty>true</manufacturer_warranty>
<barcode>0156789012</barcode>
</offer>
<offer id="xiaomi12" available="true">
<name>Xiaomi 12X</name>
<vendor>Xiaomi</vendor>
<url>http://best.seller.ru/product_page.asp?pid=12345</url>
<price>62990</price>
<oldprice>69990</oldprice>
<currencyId>RUB</currencyId>
<categoryId>102</categoryId>
<picture>https://example.com/img/xiaomi_phone.png</picture>
<delivery>true</delivery>
<manufacturer_warranty>true</manufacturer_warranty>
<barcode>0123456789379</barcode>
</offer>
</offers>
</shop>
</yml_catalog>
SKU
A file will add two SKUsfor Apple iPhone 12: Apple iPhone 12 128GB and* Apple iPhone 12 256GB*.
<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="2017-02-05 17:22">
<shop>
<name>BestSeller</name>
<company>Tne Best inc.</company>
<url>http://best.seller.ru</url>
<offers>
<offer id="apple12_128gb" group_id="iphone12" available="true">
<name>Apple iPhone 12 128GB</name>
<vendor>Apple</vendor>
<url>http://best.seller.ru/product_page.asp?pid=12358</url>
<price>71990</price>
<oldprice>72990</oldprice>
<currencyId>RUB</currencyId>
<categoryId>101</categoryId>
<picture>https://example.com/img/apple_phone_128.png</picture>
<delivery>true</delivery>
<manufacturer_warranty>true</manufacturer_warranty>
<barcode>0156789012</barcode>
</offer>
<offer id="apple12_256gb" group_id="iphone12" available="true">
<name>Apple iPhone 12 256GB</name>
<vendor>Apple</vendor>
<url>http://best.seller.ru/product_page.asp?pid=12359</url>
<price>83990</price>
<oldprice>89990</oldprice>
<currencyId>RUB</currencyId>
<categoryId>102</categoryId>
<picture>https://example.com/img/apple_phone_256.png</picture>
<delivery>true</delivery>
<manufacturer_warranty>true</manufacturer_warranty>
<barcode>0156789012</barcode>
</offer>
</offers>
</shop>
</yml_catalog>
A list of all products and SKUs is stored in the offers element. One product or SKU is stored in a separate offer element.
The id attribute, which is unique for each product, is specified for the offer element.
The structure of the yml file is almost the same for products and SKUs. The only difference is the following: when importing SKU for the offer element you need to specify not only id, but also group_id — a product identifier.
Please note that SKUs are different variations of one product, so the value of the group_id attribute must be the same for all SKUs of this product.
To import a file with a list of products, go to Market —> Products. Click on the icon on the top toolbar, and then select what exactly you want to import — a product.

Click on the download area and select a file on your device:

Start the import process by clicking "Import" on the top toolbar.
Then import SKUs. To do this, follow all the steps described in this paragraph.
Step 3. Set up sending an API request when adding an order
When a visitor of an online store places an order, an API request with the order data must be sent to the platform.