Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heybran/email-suggestion
A web component to detect email domain typo and suggest correct email domain.
https://github.com/heybran/email-suggestion
javascript web webcomponents
Last synced: about 1 month ago
JSON representation
A web component to detect email domain typo and suggest correct email domain.
- Host: GitHub
- URL: https://github.com/heybran/email-suggestion
- Owner: heybran
- Created: 2024-04-28T13:55:21.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-07T15:05:42.000Z (6 months ago)
- Last Synced: 2024-10-02T06:44:21.998Z (about 2 months ago)
- Topics: javascript, web, webcomponents
- Language: JavaScript
- Homepage: https://email-suggestion.netlify.app/demo.html
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ``
A web component to detect email domain typo and suggest correct email domain. Under the hood, it's using `Levenshtein Distance` algorithm to detect mistyped email addresses.
[Demo](https://email-suggestion.netlify.app/demo.html)
## Installation
Via [npm](https://www.npmjs.com/package/email-suggestion) or download [email-suggestion.js](email-suggestion.js) directly and use it in your project.
```
npm install email-suggestion
```## Usage
Add your list of domains that you want to suggest into `data-domains` attribute. And to add a custom prompt message asking user to confirm their email address, you can use the `data-suggestion` attribute, here component will show a `confirm()` prompt with message: `It's possible your email is [email protected]?`. `$email%` will be replaced with the suggested email address to the email entered by the user.
```html
```