Comments (3)
Implementation proposal
- Various events are generated by the Vendure Server and published via the EventBus (#40).
EmailEventHandlers
listen for a specific event and convert these events intoEmailContext
instances, which contain the information required to generate and send an email.- The
EmailGenerator
takes anEmailContext
object and uses the data to generate the body of the email based on a template. There will be standard, built-in templates but there must be a very simple way to provide custom templates since this will be needed by most shops. - The output of the
EmailGenerator
is aGeneratedEmail
instance, which is just theEmailContext
with the addition of abody
string. - The
GeneratedEmail
is passed to theEmailTransport
which actually sends the email to the recipient.
from vendure.
Templating
Templates should use a templating language to allow the actual data (customer name, order contents etc) to be interpolated when generating the HTML.
The specific quirks of designing emails (needs tables for layout, inline styles etc) suggest the use of a email framework. The main contenders are:
I like the look of MJML. However, it does not support templating features itself (interpolating variables, for loops) so we would need an additional templating layer which generates the MJML, which is then compiled into HTML. Handlebars is an obvious choice for the templating part.
from vendure.
Current status: The infrastructure is all there for transactional emails now. The only thing missing is the definition of all the email types (right now there is only "order confirmation" and "email verification".
The plan is to create config and templates for the other types as development of the rest of the UI / shopfront progresses. So I'll close this issue now since the foundation is complete.
from vendure.
Related Issues (20)
- [v2][Admin UI] Currency wrongly displayed after changing channel currency
- V2 - Shipping 2 out of 3 items for the same order line doesn't transition the order to PartiallyShipped
- [v2][core] Search query, for the non-default channel language products appear twice
- Missing index on the order table
- `search` endpoint returns duplicated results for translated products
- Extend Vendure metrics plugin and replace the Pinelab Metrics plugin
- Bug in DraftOrder
- [v2.0.0-beta2][core] two identical history records after adding payment HOT 1
- JavaScript heap out of memory with custom entity relation on products
- Assets page in responsive mode
- Newly created seller cannot log in to the admin dashboard HOT 1
- How to add additional features Like SMS and other mutations. HOT 1
- [v2.0.0-beta3][email-plugin] missed passed `custom` languageCode from `setLanguageFn` to `templateLoader`
- Can't create more than one product variant without option group HOT 2
- Backend language is reset to English after browser refresh
- Postgres Migration for Money columns still using 4 byte int HOT 2
- Customer list doesn't show customers in the customers section HOT 2
- vendure 2.0: Multivendor, 'mark as shipped; error HOT 2
- Vendure 2.0.0 - Custom field UI regarding facet-value-form-input HOT 2
- [v2.0.0] Create a new channel HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vendure.