This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(no ticket): [update] Email Templates, add edited versions (#1500)
- Loading branch information
Sarah Riehl
authored
Oct 16, 2023
1 parent
4500c3c
commit ae0b8bd
Showing
15 changed files
with
2,724 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
Oops, something went wrong.