https://github.com/mat-sz/vue-letter
✉️ Display HTML e-mails in your Vue projects. (Targets Gmail rendering.)
https://github.com/mat-sz/vue-letter
email gmail javascript javascript-library vue vue-components vuejs vuejs2
Last synced: 8 months ago
JSON representation
✉️ Display HTML e-mails in your Vue projects. (Targets Gmail rendering.)
- Host: GitHub
- URL: https://github.com/mat-sz/vue-letter
- Owner: mat-sz
- License: bsd-3-clause-clear
- Created: 2020-04-21T17:51:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-08T17:09:15.000Z (over 1 year ago)
- Last Synced: 2025-09-22T09:59:54.418Z (9 months ago)
- Topics: email, gmail, javascript, javascript-library, vue, vue-components, vuejs, vuejs2
- Language: Vue
- Homepage:
- Size: 289 KB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
vue-letter
Vue.js port of [react-letter](https://github.com/mat-sz/react-letter).
Available in [NPM](https://npmjs.com/package/vue-letter), can be installed with `yarn add vue-letter` or `npm install vue-letter`.
## Usage
```html
import { Letter } from 'vue-letter';
```
## Attributes
All [react-letter](https://github.com/mat-sz/react-letter) properties are supported.
| Attribute | Type | Description | Default |
| ------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- |
| className | String | Class name of the wrapper div. | `undefined` |
| html | String | Unsanitized e-mail HTML contents. | |
| text | String | Unsanitized e-mail text contents (fallback if html is not set or empty). | |
| useIframe | Boolean | Should the HTML be wrapped in an iframe. | `false` |
| iframeTitle | String | Iframe title, usually set to subject of the message. | |
| rewriteExternalResources | Function(string) => string | The result of this function will be used to rewrite the URLs for url(...) in CSS and src attributes in HTML. | |
| rewriteExternalLinks | Function(string) => string | The result of this function will be used to rewrite the URLs for href attributes in HTML. | |
| allowedSchemas | String[] | List of allowed URL schemas. | `['http', 'https', 'mailto']` |
| preserveCssPriority | Boolean | Preserves CSS priority (!important). | `true` |