1b.app
Link copied -

How to correctly write the html code in a letter so that a list of all products from the order is sent

There is a Send message by email action, which is used to send a letter to the Client

But only ONE product from the entire list is sent in the letter.

How to write so that the letter displays all the products of the order?

Now I use the following html code for the table of products from the letter:

<p><span style="font-family: arial, helvetica, sans-serif;">{|foreach from=$basketsArray item="b"|}{|/foreach|}</span></p>

<table border="1" style="width: 100%; border-collapse: collapse; border-style: solid;" cellpadding="5"><caption></caption>

<tbody>

<tr>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Product ID</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Image</span></strong></span></td>

<td style="width: 50%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Title</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Quantity</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Price</span></strong></span></td>

</tr>

<tr>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.productid|} <br /></span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;"><img src="https:/ /icoloronebox.crm-onebox.com/app/mailing-template/add/{|$b.image|}" width="60" height="60" /><br /></span></td>

<td style="width: 50%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.name|} </span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.count|} </span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.price|} </span></td>

</tr>

</tbody>

</table>
Original question is available on version: ua Вячеслав Легеза

Answers:

Вітаю!
Спробуйте ось так:

<table border="1" style="width: 100%; border-collapse: collapse; border-style: solid;" cellpadding="5">
<tbody>
<tr>

<td style="width: 10%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">ID продукта</span></strong></span></td>

<td style="width: 10%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Изображение</span></strong></span></td>

<td style="width: 50%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Название</span></strong></span></td>

<td style="width: 10%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Количество</span></strong></span></td>

<td style="width: 10%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Цена</span></strong></span></td>

</tr>
<p>{|foreach from=$basketsArray item="b"|}</p>
<tr>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; цвет: #000080;">{|$b.productid|} <br /></span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; цвет: #000080;"><img src="https:/ /icoloronebox.crm-onebox.com/app/mailing-template/add/{|$b.image|}" width="60" height="60" /><br /></span></td>

<td style="width: 50%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; цвет: #000080;">{|$b.name|} </span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; цвет: #000080;">{|$b.count|} </span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; цвет: #000080;">{|$b.price|} </span></td>

</tr>
<p>{|/foreach|}</p>

</tbody>
</table>
19.06.2023, 16:13

Легеза Вячеслав iCOLOR OneBox
ФОП Легеза В.В.
Personal license
Leave a message in this thread and the user's contacts will be shown to you


Luts Bogdan Alexandrovich

WANBOX CORP wrote:

I live!

Try the axis like this:

<table border="1" style="width: 100%; border-collapse: collapse; border-style: solid;" cellpadding="5">

<body>

<tr>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Product ID</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Image</span></strong></span></td>

<td style="width: 50%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Title</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Number</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Price</span></strong></span></td>

</tr>

<p>{|foreach from=$basketsArray item="b"|}</p>

<tr>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.productid|} <br /></span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;"><img src="https:/ /icoloronebox.crm-onebox.com/app/mailing-template/add/{|$b.image|}" width="60" height="60" /><br /></span></td>

<td style="width: 50%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.name|} </span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.count|} </span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.price|} </span></td>

</tr>

<p>{|/foreach|}</p>

</tbody>

</table>



sorry, no

did not work
19.06.2023, 16:30
Вячеслав Легеза Original comment available on version: ru

Тоді ось так:
Тоді ось так:

<table border="1" style="width: 100%; border-collapse: collapse; border-style: solid;" cellpadding="5">
<tbody>
<tr>
<td style="width: 10%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">ID продукту</span></strong></span></td>
<td style="width: 10%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Изображение</span></strong></span></td>
<td style="width: 50%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Название</span></strong></span></td>
<td style="width: 10%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Колічество</span></strong></span></td>
<td style="width: 10%; text-align: центр;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Цена</span></strong></span></td>
</tr>
{|foreach from=$basketsArray item="b"|}
<tr>
<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; колір: #000080;">{|$b.productid|} <br /></span></td>
<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; колір: #000080;"><img src="https:/ /icoloronebox.crm-onebox.com/app/mailing-template/add/{|$b.image|}" width="60" height="60" /><br /></span></td>
<td style="width: 50%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; колір: #000080;">{|$b.name|} </span></td>
<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; колір: #000080;">{|$b.count|} </span></td>
<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; колір: #000080;">{|$b.price|} </span></td>
{|/foreach|}
</tr>
</tbody>
</table>
19.06.2023, 16:46

Легеза Вячеслав iCOLOR OneBox
ФОП Легеза В.В.
Personal license
Leave a message in this thread and the user's contacts will be shown to you


Luts Bogdan Alexandrovich

WANBOX CORP wrote:

Move the axis like this:

Move the axis like this:

<table border="1" style="width: 100%; border-collapse: collapse; border-style: solid;" cellpadding="5">

<body>

<tr>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Product ID</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Image</span></strong></span></td>

<td style="width: 50%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Title</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Number</span></strong></span></td>

<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Price</span></strong></span></td>

</tr>

{|foreach from=$basketsArray item="b"|}

<tr>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.productid|} <br /></span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;"><img src="https:/ /icoloronebox.crm-onebox.com/app/mailing-template/add/{|$b.image|}" width="60" height="60" /><br /></span></td>

<td style="width: 50%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.name|} </span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.count|} </span></td>

<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.price|} </span></td>

{|/foreach|}

</tr>

</tbody>

</table>



the same

only one item
19.06.2023, 17:05
Вячеслав Легеза Original comment available on version: ru

https://tppr.me/XQ2tG works for me
Maybe you have only 1 product in the process?
Or an error somewhere in the code
19.06.2023, 18:26
Original comment available on version: ua

Легеза Вячеслав iCOLOR OneBox
ФОП Легеза В.В.
Personal license
Leave a message in this thread and the user's contacts will be shown to you


Bohdan Alexandrovych Luts

VANBOX CORP wrote:

Maybe you have only 1 product in the process?



and no, there are many products

and copied and pasted the code as is
19.06.2023, 20:03
Вячеслав Легеза Original comment available on version: ua

Легеза Вячеслав iCOLOR OneBox
ФОП Легеза В.В.
Personal license
Leave a message in this thread and the user's contacts will be shown to you

Luts Bogdan Alexandrovich
WANBOX CORP wrote:
Move the axis like this:
Move the axis like this:
<table border="1" style="width: 100%; border-collapse: collapse; border-style: solid;" cellpadding="5">
<body>
<tr>
<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Product ID</span></strong></span></td>
<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Image</span></strong></span></td>
<td style="width: 50%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Title</span></strong></span></td>
<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Number</span></strong></span></td>
<td style="width: 10%; text-align: center;"><span style="color: #003d6a; font-family: arial, helvetica, sans-serif;"><strong><span style=" font-size: 16px;">Price</span></strong></span></td>
</tr>
{|foreach from=$basketsArray item="b"|}
<tr>
<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.productid|} <br /></span></td>
<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;"><img src="https:/ /icoloronebox.crm-onebox.com/app/mailing-template/add/{|$b.image|}" width="60" height="60" /><br /></span></td>
<td style="width: 50%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.name|} </span></td>
<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.count|} </span></td>
<td style="width: 10%;"><span style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: #000080;">{|$b.price|} </span></td>
{|/foreach|}
</tr>
</tbody>
</table>

taking just the bare code without other parts and in this way everything went well
I will joke here at another place of pardon
Thanks for the help
19.06.2023, 20:11
Вячеслав Легеза Original comment available on version: ru

Сусяк Ігор
Integrator.com.ua
Personal license
Vyacheslav, hello
here is an example of a letter from a work project:
{|foreach from="$basketsArray" item="e"|}
{|$e.name|} {|$e.shopurl|}
{|/foreach|}
19.06.2023, 20:39
Original comment available on version: ua

Легеза Вячеслав iCOLOR OneBox
ФОП Легеза В.В.
Personal license
Leave a message in this thread and the user's contacts will be shown to you

Ihor Susiak
The integrator wrote:
Vyacheslav, hello
here is an example of a letter from a work project:
{|foreach from="$basketsArray" item="e"|}
{|$e.name|} {|$e.shopurl|}
{|/foreach|}

if there is no html code, then there are no questions
everything is clear there
but there were problems with html, which I fixed thanks to Luts Bohdan Aleksandrovych
thank you :)
19.06.2023, 22:22
Вячеслав Легеза Original comment available on version: ua

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment