Setup in Customer's Canvas - aurigma/direct-mail-app-sample GitHub Wiki
To make the app work, you need products. We have prepared a few products to work with, but you can delete them and create your own. Next, they need to be correctly linked to your tenant on the Customer's Canvas Hub. This is a very important part because our setup is quite complex.
- Upload assets to Customer's Canvas Hub
- Create a product in Customer's Canvas
- Сreate a product in Direct mail app via the backend API
- Establish a connection of Direct Mail App product with the product in Customer's Canvas
- Let's check if the product is connected
Upload assets to Customer's Canvas Hub
First, you need to upload assets to your tenant storage.
Assets are the data used by Customer's Canvas to implement various web-to-print scenarios. They include designs, fonts, images, and some other types.
You can manage these data in the Assets section of BackOffice. Your assets are separated by data type there, but the way you organize them, manipulate files, and so on is the same for all asset types. It is explained in detail in the File manager article.
Create a product in Customer's Canvas
Before you start creating products, we recommend that you read the documentation on PIM Module
Create a product in Customer's Canvas Hub
You need to create a PIM product in Customer's Canvas Hub:
Fill in the fields: Name, Description and select Personalization workflow and Processing pipeline
Configure options and variants
Configure Options and Variants for products.
Connect designs and mockups to options
You need to Connect designs and mockups to variants to the products.
First, let's select all the product variants for designs and mockups. To do so, open the product list, click the ellipsis in a product row, select Edit, click the Designs tab, and select all design options. Let's do the same for mockups: click the Mockup tab and select all mockup options.
Next, to connect assets to your product, navigate to Products, click the ellipsis, and then select Asset connections.
Here you see asset connections for this product. There are two tabs: Designs and Mockups. In these tabs, you can manipulate the correspondent assets. To generate preview images, you need to upload mockups of special types to the Customer's Canvas assets.
Add design custom fields (optional)
You can also add a description to the product variant, for this you need to add a custom field with a description to the designs. Navigate to the Designs section, right-click a design, click Properties > Fields > Add > Custom Field, enter description to the key and corresponding text to the value. This description will be displayed on the Choose a Template page.
For more details about setting up products in Customer's Canvas, refer to the documentation.
Сreate a product in Direct mail app via the backend API
To create a product in Direct mail app, you need to send a request for its creation to the Backend API, the easiest way to do this is through Swagger. To open it, add /swagger
to the base URL Backend. e.g.http://localhost:8092/swagger
.
Next, send a POST request to the endpoint: /api/direct-mail/v1/products
with body:
{
"title": "Notebook",
"price": 19.99,
"categoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
In response you will receive a model of the created product, remember its id, we will need it later.
Establish a connection of Direct Mail App product with the product in Customer's Canvas
You need to associate Direct Mail App products with PIM products in Customer's Canvas Hub:
-
On the Products tab, select a product and click the Links tab.
-
Enter the product ID of the product created above in the Storefront Products field. Note that if one ID is already associated with a product in BackOffice, it cannot be reused.
Let's check if the product is connected
If you have done everything correctly, the product you have created will appear on the Setup screen of the application.