added cc, bcc, body and subject also for no-spam (docs), added examples

This commit is contained in:
Matteo Manzinello 2019-05-13 12:24:01 +02:00
parent a8ef614a7c
commit d3aa6d887b
1 changed files with 24 additions and 9 deletions

View File

@ -43,11 +43,15 @@ you can also import mailgo in `<head>` using `defer`
### default
**by default all the `mailto:` links will be enabled with mailgo only importing the script!**
**by default all the `mailto:` links will be enabled with mailgo automatically** (and with the default usage in the modal will appear also cc, bcc, subject and body parameter, if provided)
(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**
Do you want to prevent the spam? Use a _no-spam usage_ instead the default usage
to exclude a single 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>
```
### no-spam usage #1 (recommended)
@ -70,15 +74,26 @@ Do you want to prevent the spam? Use a _no-spam usage_ instead the default usage
- add the attribute `mailgo` to `<a>`
- add `data-address` and `data-domain` to re-create your email address
#### exclude a mailto
### cc, bcc, body and subject
to exclude a mailto link add to the `<a>` element the class `no-mailgo` like in this example:
**mailgo** also supports cc, bcc, subject and body in no-spam installation using the parameters:
```
<a class="no-mailgo" href="mailto:matteo@manzinello.dev">matteo@manzinello.dev</a>
```
- `data-cc-address` and `data-cc-domain` to recreate cc: `data-cc-address@data-cc-domain`
- `data-bcc-address` and `data-bcc-domain` to recreate bcc: `data-bcc-address@data-bcc-domain`
- `data-subject` for the subject of the email
- `data-body` for the body of the email
this solution can be applied only to the default installation (`<a>` element with href starting with `mailto:`, the classic mailto link)
---
## example
This is a complete **mailgo** example with the no-spam usage #1:
`<a href="#mailgo" data-address="matteo" data-domain="manzinello.dev" data-cc-address="matteomanzinello" data-cc-domain="gmail.com" data-bcc-address="hello" data-bcc-domain="matteomanzinello.com" data-subject="A strange email" data-body="This email is for me with me also in cc and in bcc">write me!</a>`
This is a more simple example (also with no-spam #1 usage):
`<a href="#mailgo" data-address="matteo" data-domain="manzinello.dev">write me!</a>`
---