mailymaily/README.md

77 lines
1.9 KiB
Markdown
Raw Normal View History

# 💌 mailgo - a different mailto (WIP)
2019-04-30 07:29:06 +00:00
2019-05-07 14:30:43 +00:00
![mailgo screencast](/assets/video/mailgo-v0.2.1-screencast.gif)
2019-05-06 10:52:30 +00:00
(see it in action! <https://mailgo.js.org>)
## what?
2019-05-05 20:24:36 +00:00
2019-05-09 15:07:25 +00:00
mailgo will substitute all the `mailto:` links with the **mailgo modal**
2019-05-07 14:13:37 +00:00
2019-05-10 14:27:28 +00:00
[![mailgo.min.js size](https://img.shields.io/github/size/manzinello/mailgo/dist/mailgo.min.js.svg?label=mailgo.min.js&style=flat-square)](https://unpkg.com/mailgo@0.2.8/dist/mailgo.min.js)
2019-05-05 20:24:36 +00:00
2019-05-06 10:52:30 +00:00
<img src="assets/img/screen-1.png" alt="mailgo modal" width="200"/>
2019-05-05 20:24:36 +00:00
2019-05-07 12:43:24 +00:00
---
## installation
2019-05-05 19:52:28 +00:00
2019-05-07 12:43:24 +00:00
add at the end of the `<body>`
2019-05-06 17:19:01 +00:00
2019-05-07 19:52:21 +00:00
```
<body>
...
2019-05-10 14:27:28 +00:00
<script src="https://unpkg.com/mailgo@0.2.8/dist/mailgo.min.js"></script>
2019-05-07 19:52:21 +00:00
</body>
```
you can also import mailgo in `<head>` using `defer`
```
<head>
...
2019-05-10 14:27:28 +00:00
<script src="https://unpkg.com/mailgo@0.2.8/dist/mailgo.min.js" defer></script>
2019-05-07 19:52:21 +00:00
</head>
```
2019-05-09 08:06:11 +00:00
(note: the GitHub `/dist` is totally unstable, use `unpkg` or `npm` to test **mailgo**, thanks!)
2019-05-07 12:43:24 +00:00
---
2019-05-06 17:19:01 +00:00
## usage
2019-05-07 12:43:24 +00:00
### default
**by default all the `mailto:` links will be enabled with mailgo only importing the script!**
(and with the default usage in the modal will appear also cc, bcc, subject and body parameter if provided)
Do you want to prevent the spam? Use a _no-spam usage_ instead the default usage
### no-spam usage #1 (recommended)
`<a href="#mailgo" data-address="matteo" data-domain="manzinello.dev">write me!</a>`
- add `href="#mailgo"` to `<a>`
- add `data-address` and `data-domain` to re-create your email address
2019-05-06 17:19:01 +00:00
2019-05-07 12:43:24 +00:00
### no-spam usage #2
2019-05-06 17:19:01 +00:00
`<a class="mailgo" data-address="matteo" data-domain="manzinello.dev">write me!</a>`
2019-05-07 12:43:24 +00:00
- add `class="mailgo"` to `<a>`
- add `data-address` and `data-domain` to re-create your email address
2019-05-05 19:52:28 +00:00
2019-05-07 12:43:24 +00:00
#### exclude a mailto
to exclude a mailto link add to the `<a>` element the class `no-mailgo` like in this example:
```
<a class="no-mailgo" href="mailto:matteo@manzinello.dev">matteo@manzinello.dev</a>
```
2019-05-06 17:19:01 +00:00
---
2019-05-06 07:54:09 +00:00
[![NPM](https://nodei.co/npm/mailgo.png)](https://nodei.co/npm/mailgo/)
2019-05-06 17:19:01 +00:00
<https://mailgo.js.org>