Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#65020] documentation add information regarding smarty #378

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e14664e
Update personalization-variables.md
DamianWantzing Apr 17, 2024
cc8b624
Create personalization-integration-variables
DamianWantzing Apr 17, 2024
f7243f0
Update and rename personalization-integration-variables to personaliz…
DamianWantzing Apr 17, 2024
6c9b4c2
Add personalization integration variables document
DamianWantzing Apr 17, 2024
311d225
change text slightly
DamianWantzing Apr 17, 2024
0575885
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
61b12c3
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
4d15431
Update personalization-variables.md
DamianWantzing Apr 26, 2024
9a39c92
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
5252f85
Update personalization.md
DamianWantzing Apr 26, 2024
8bc69d9
Update personalization.md
DamianWantzing Apr 26, 2024
f0450d6
Update personalization.md
DamianWantzing Apr 26, 2024
685e00b
Update personalization.md
DamianWantzing Apr 26, 2024
88fdeeb
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
704e153
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
9f43de9
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
acabbfe
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
8d94030
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
70062bf
Update personalization-integration-variables.md
DamianWantzing Apr 26, 2024
66fa03f
Update personalization.md
DamianWantzing Apr 26, 2024
c47da09
updates
DamianWantzing Apr 26, 2024
54418d1
Update personalization.md
DamianWantzing Apr 26, 2024
673e322
make italic
DamianWantzing Apr 26, 2024
c948c5e
try bold
DamianWantzing Apr 26, 2024
7aae542
use a dollar sign
DamianWantzing Apr 26, 2024
cf95fc9
Update personalization-variables.md
DamianWantzing Apr 29, 2024
63a4909
Update personalization-variables.md
DamianWantzing Apr 29, 2024
b294160
Update personalization-variables.md
DamianWantzing Apr 29, 2024
e0a82e4
Update personalization-variables.md
DamianWantzing Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Publisher/en/personalization-integration-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Personalization for Native integration variables

This is a list of all the available personalization variables per native integration.

## Magento 2

You can see which properties are available on each variable by referencing the [Magento API documentation](https://developer.adobe.com/commerce/webapi/rest/quick-reference/)

* **{$identifier.order.$orderID}**: fetch an order by its ID
* **{$identifier.order.$orderID.customer}**: fetch the customer for this order
* **{$identifier.order.$orderID.items[].product}**: fetch the product from the order item
* **{$identifier.product.sku}**: fetch a product by its SKU
* **{$identifier.cart.$cartID}**: fetch a cart by its ID
* **{$identifier.cart.$cartID.customer}**: fetch the customer for this cart
* **{$identifier.cart.$cartID.items[].product}**: fetch the product from the cart item

### Iterable properties

The following properties can be used in a foreach. You can find an [example on how to use them here](./personalization#native-integrations).

* **{$identifier.products}**: can be used to loop over all the products in the webshop
* **{$identifier.orders}**: can be used to loop over all the orders in the webshop
* **{$identifier.carts}**: can be used to loop over all the carts in the webshop
20 changes: 20 additions & 0 deletions Publisher/en/personalization-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,26 @@ The {$mailing} object has more properties, en contains some mailing settings:
* **{$mailing.snapshot.created}**: time when a snapshot of the document was created (YYYY-MM-DD hh:mm::ss format)
* **{$mailing.snapshot.subject}**: mailing subject line

## Native integrations

If you connect your platform with Copernica, your product and order information will become available as personalization variables in your templates.
You can directly use this information in your mailings.

When connecting your platform to Copernica you have to enter an identifier.
This identifier is the name of the variable that you can use to fetch information from your platform.

For example if you use the identifier "magento", you can personalize with variables such as:

* **{$magento.product.shoes.name}**
* **{$magento.product.shoes.description}**
* **{$magento.order.1.grand_total}**

All fields that are returned by the API of your platform are made available, so not only are the fields "name" and "title" available, but also fields such as "price" and "product_links".

You can check the API documentation of the connected platform to find out which fields are available.

For a full list of available variables for your integration see [Native integration properties](./personalization-integration-variables).

## Extra personalization variables

When you're editing a template, you can add extra personalization variables.
Expand Down
29 changes: 29 additions & 0 deletions Publisher/en/personalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,35 @@ If there are subprofiles
If there aren't’ any subprofiles
{/foreach}
```
#### Native integrations

You can loop over certain variables in a native integration.
Available modifiers are:
* add filters using the "filter" modifier
* order using the "orderby" modifier
* limit the amount of items using the "limit" modifier

```text
{foreach from=$identifier.products|filter:"price":"<":15|orderby:"price"|limit:5 item="product"}
{$product.name}
{/foreach}
```

##### Filter modifier

The filter modifier has several variations:

* filter:"price":">":15 - checks if price is greater than 15
* filter:"sku":"test" - if operator is omitted, we assume an 'equals' comparison
* filter:"sku" - if value is also omitted, we do a notnull check

##### Orderby modifier

The orderby modifier can be used ascending or descending

orderby:"price" - sorts by price, by default in an ascending direction
orderby:"price":"desc" - sorts by price in an descending direction


## Variables

Expand Down