Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/word-wrap-1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Riehl authored Dec 15, 2023
2 parents 8b818c8 + be16641 commit 8975c6a
Show file tree
Hide file tree
Showing 77 changed files with 5,023 additions and 2,745 deletions.
32 changes: 32 additions & 0 deletions models/email_templates/combined/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Email Template Objects

Object schemas for handlebars email templates.

## Directory structure

```shell
.
├── data # json data for generating and updating yaml schema
├── _all.yml # Groups models together for docs
├── account_details_changed_email.yml # Individual email template models
├── ...
```

## Updating models

To generate a new model from json data and overwrite the existing schema file:

1. Copy and paste template `data-*.json` from [localization-tools](https://github.com/bigcommerce/localization-tools/blob/master/email-check/modules/email-templates/types/abandoned_cart_email/data-0.json) to `models/_json/email_templates`.
2. Use `models/json2schema.py` to convert the json data to a yaml schema.

Example:

```bash
cat data.json | python json2schema.py > schema.yml
```

Bash for overwriting all email template models:

```bash
for f in models/email_templates/data/*.json; do cat $f | python models/json2schema.py > ${f%.*}.yml; mv ${f%.*}.yml models/email_templates/; done
```
169 changes: 169 additions & 0 deletions models/email_templates/combined/abandoned_cart_email.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
title: Abandoned Cart Email Template
description: Abandoned cart email triggers when a shopper doesnʼt complete an order.
type: object
properties:
notification:
type: array
items:
type: object
properties:
unsubscribe_link:
type: string
checkout_link:
type: string
coupon:
type: array
items:
type: object
properties:
code:
type: string
type:
type: array
items:
type: object
properties:
value:
type: string
formatted:
type: string
amount:
type: array
items:
type: object
properties:
value:
type: number
format: float
formatted:
type: string
cart:
type: array
items:
type: object
properties:
products:
type: array
items:
type: object
properties:
type: array
items:
type: object
properties:
id:
type: number
url:
type: string
name:
type: string
quantity:
type: integer
sku:
type: string
thumbnail:
type: string
attributes:
type: array
items:
type: object
properties:
type: array
items:
type: object
properties:
name:
type: string
value:
type: string
price:
type: array
items:
type: object
properties:
value:
type: number
format: float
formatted:
type: string
type:
type: array
items:
type: object
properties:
value:
type: integer
formatted:
type: string
store:
type: array
items:
type: object
properties:
name:
type: string
domain_name:
type: string
logo:
type: array
items:
type: object
properties:
title:
type: string
name:
type: string
url:
type: string
ssl_path:
type: string
cdn_path:
type: string
image_directory:
type: string
img_path:
type: string
path_normal:
type: string
path:
type: string
address:
type: string
phone_number:
type: string
language:
type: array
items:
type: object
properties:
code:
type: string
direction:
type: string
customer:
type: array
items:
type: object
properties:
first_name:
type: string
full_name:
type: string
email:
type: string
group:
type: array
items:
type: object
properties:
id:
type: number
name:
type: string
misc:
type: array
items:
type: object
properties:
year:
type: integer
119 changes: 119 additions & 0 deletions models/email_templates/combined/abandoned_cart_email_deprecated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
title: Abandoned Cart Email Template (Deprecated)
description: Abandoned cart email triggers when a shopper doesnʼt complete an order.
type: object
deprecated: true
properties:
abandoned_cart:
type: object
title: deprecated
deprecated: true
properties:
body:
type: string
unsubscribe_link:
type: string
store:
type: object
deprecated: true
properties:
name:
type: string
domain_name:
type: string
logo:
type: object
deprecated: true
properties:
title:
type: string
name:
type: string
url:
type: string
ssl_path:
type: string
cdn_path:
type: string
image_directory:
type: string
img_path:
type: string
path_normal:
type: string
description: 'Path to the store (i.e., domain + protocol)'
path:
type: string
address:
type: string
language:
type: object
properties:
code:
type: string
direction:
type: string
description: 'Left to right or right to left, depending on the language'
customer:
type: object
deprecated: true
properties:
first_name:
type: string
full_name:
type: string
email:
type: string
group:
type: array
items:
type: object
properties:
name:
type: string
misc:
type: object
deprecated: true
properties:
year:
type: integer
translations:
type: object
deprecated: true
properties:
en:
type: object
properties:
unsubscribe:
type: string
examples:
Abandoned Cart example (deprecated):
value:
abandoned_cart:
body: You recently visited our online store and we noticed that you didnʼt complete your order.\n <br>To complete your order right now, just click on the link below:\n <a href=\"example.com/complete-order\">Complete your order</a>
unsubscribe_link: 'example.com/unsubscribe'
store:
name: My Dev Store 97434969
domain_name: my-dev-store-97434969.store.bcdev
logo:
title: [= My Dev Store 97434969 =]
name: avatar-2020_1612860757__16350.jpeg
url: 'https://valeryderived-cloud-dev-vm.store.bcdev/store/f1kr2akw96/product_images/avatar-2020_1612860757__16350.jpeg'
ssl_path: 'https://my-dev-store-97434969.store.bcdev'
cdn_path: 'https://valeryderived-cloud-dev-vm.store.bcdev/store/f1kr2akw96'
image_directory: product_images
img_path: 'https://valeryderived-cloud-dev-vm.store.bcdev/r08d84bb67d250c7624502ed76d8e0bafb1a5cacf/g-themes/ClassicNext/images'
path_normal: 'https://my-dev-store-97434969.store.bcdev'
path: 'https://my-dev-store-97434969.store.bcdev'
address: '123 Fake St, Dallas, TX 75225'
language:
code: en
direction: ltr
customer:
first_name: John
full_name: John Jr
email: '[email protected]'
misc:
year: 2021
translations:
en:
unsubscribe: '<a href=\"example.com/unsubscribe\">Unsubscribe</a> from future emails like this.'
Loading

0 comments on commit 8975c6a

Please sign in to comment.