Skip to content

Commit

Permalink
🔖 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzaganelli committed Jun 10, 2021
1 parent 874e76b commit 83d02cf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ The **Email Designer** plugin should appear in the **Plugins** section of Strapi

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.**

Tips: in the template's body is possible to iterate array like this:

```javascript
<% _.forEach(order.products, function(product) { %>
<li><%- product.name %></li>
<li><%- product.price %></li>
<% }); %>
```

2. Send email programmatically:

```javascript
Expand All @@ -97,11 +106,22 @@ The **Email Designer** plugin should appear in the **Plugins** section of Strapi
},
{
templateId: 1, // required - you can get the template id from the admin panel
subject: `Welcome to My Project`, // If provided here will override the template's subject. Can include variables like `Welcome to <%= project_name %>`
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 %>!`
},
{
// this object must include all variables you're using in your email template
project_name: 'My Project',
user: {
firstName: 'John',
lastName: 'Doe',
},
order: {
products: [
{ name: 'Article 1', price: 9.99 },
{ name: 'Article 2', price: 5.55 },
],
},
shippingCost: 5,
total: 20.54,
}
);
} catch (err) {
Expand Down Expand Up @@ -195,7 +215,7 @@ npm run cypress:open
## 🚧 Roadmap

- [x] Template composer helper
- [ ] Import design feature
- [x] Import design feature
- [ ] Override Strapi's core email system feature
- [ ] Preview email with real data feature
- [ ] Tags feature
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "strapi-plugin-email-designer",
"version": "1.0.0",
"version": "1.0.1",
"description": "Strapi Email designer plugin.",
"homepage": "https://github.com/alexzaganelli/strapi-plugin-email-designer#readme",
"strapi": {
Expand Down

0 comments on commit 83d02cf

Please sign in to comment.