Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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

Email

```