Skip to content

Commit 83d02cf

Browse files
committed
🔖 1.0.1
1 parent 874e76b commit 83d02cf

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ The **Email Designer** plugin should appear in the **Plugins** section of Strapi
8282

8383
1. Design your template with easy on the visual composer. For variables use [lodash templating language](https://lodash.com/docs/4.17.15#template). **You can leave the text version blank to automatically generate a text version of your email from the HTML version.**
8484

85+
Tips: in the template's body is possible to iterate array like this:
86+
87+
```javascript
88+
<% _.forEach(order.products, function(product) { %>
89+
<li><%- product.name %></li>
90+
<li><%- product.price %></li>
91+
<% }); %>
92+
```
93+
8594
2. Send email programmatically:
8695

8796
```javascript
@@ -97,11 +106,22 @@ The **Email Designer** plugin should appear in the **Plugins** section of Strapi
97106
},
98107
{
99108
templateId: 1, // required - you can get the template id from the admin panel
100-
subject: `Welcome to My Project`, // If provided here will override the template's subject. Can include variables like `Welcome to <%= project_name %>`
109+
subject: `Thank you for your order`, // If provided here will override the template's subject. Can include variables like `Thank you for your order <%= user.firstName %>!`
101110
},
102111
{
103112
// this object must include all variables you're using in your email template
104-
project_name: 'My Project',
113+
user: {
114+
firstName: 'John',
115+
lastName: 'Doe',
116+
},
117+
order: {
118+
products: [
119+
{ name: 'Article 1', price: 9.99 },
120+
{ name: 'Article 2', price: 5.55 },
121+
],
122+
},
123+
shippingCost: 5,
124+
total: 20.54,
105125
}
106126
);
107127
} catch (err) {
@@ -195,7 +215,7 @@ npm run cypress:open
195215
## 🚧 Roadmap
196216

197217
- [x] Template composer helper
198-
- [ ] Import design feature
218+
- [x] Import design feature
199219
- [ ] Override Strapi's core email system feature
200220
- [ ] Preview email with real data feature
201221
- [ ] Tags feature

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strapi-plugin-email-designer",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Strapi Email designer plugin.",
55
"homepage": "https://github.com/alexzaganelli/strapi-plugin-email-designer#readme",
66
"strapi": {

0 commit comments

Comments
 (0)