Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/labor-digital/mjml-components
A library of MJML components for internal email projects
https://github.com/labor-digital/mjml-components
mjml
Last synced: about 1 month ago
JSON representation
A library of MJML components for internal email projects
- Host: GitHub
- URL: https://github.com/labor-digital/mjml-components
- Owner: labor-digital
- License: apache-2.0
- Created: 2021-06-22T10:23:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-13T14:04:10.000Z (11 months ago)
- Last Synced: 2024-03-14T15:51:17.508Z (10 months ago)
- Topics: mjml
- Language: JavaScript
- Homepage:
- Size: 213 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LABOR - MJML Components
This package contains a number of custom mjml components.
## Installation
Install this package using npm:
```
npm install @labor-digital/mjml-components
```Currently this package only supports `MJML 4.7.*`.
## Setup
Before using the components they need to be registered. This can be done by adding the following code to a gulp task.
### Register specific components
```js
import { registerComponent } from 'mjml-core'
import { LaborResponsiveImage, LaborRoundedButton } from '@labor-digital/mjml-components'const registerComponents = () => {
registerComponent(LaborResponsiveImage)
registerComponent(LaborRoundedButton)
}exports.build = gulp.series(
(cb) => {
registerExternalComponents()
return cb()
},
// do other stuff
)
```### Register all available components
```js
import { registerComponent } from 'mjml-core'
import * as Components from '@labor-digital/mjml-components'const registerExternalComponents = () => {
Object.values(Components)
.filter((c) => c !== undefined)
.forEach((component) => registerComponent(component))
}exports.build = gulp.series(
(cb) => {
registerExternalComponents()
return cb()
},
// do other stuff
)
```## Documentation
Will be available in the future.