npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

email-verification-code-sendgrid

v2.2.0

Published

Using sendgrid, we added <strong>2 other functions</strong> to make the verification more secure and more intense.<br> Now you can confirm with a Token that is generated at the beginning, or confirm with the code and the token at the same time!

Downloads

19

Readme

Email Verification Code Sendgrid- V2

What has changed?

With Sendgrid, We added 2 other functions to make the verification more secure and more intense. Now you can confirm with a Token that is generated at the beginning, or confirm with the code and the token at the same time!

How the changes can be helpful?

With the Token Code, you can easily verify the email with a link redirection without restraint!

This package is a fork from email-verification-code by [email protected]

Installation

This is a Node.js module available through the npm registry.

Installation is done using the npm install command:

npm install email-verification-code-sendgrid --save

Usage

const {
  sendCode,
  verifyCode,
  verifyToken,
  verifyBoth,
} = require("email-verification-code-sendgrid");

// Send the code to the User Email.

const data = {
  smtpInfo: {
    host: "0.0.0.0",
    port: 587,
    user: "[email protected]",
    pass: 23454,
  },
  company: {
    name: "danisifon.",
    email: "[email protected]",
  },
  mailInfo: {
    emailReceiver: "[email protected]",
    subject: "Code Confirmation",
    text(code) {
      return `The Confirmation Code is: ${code}`;
    },
    html(code) {
      return `<p>The Confirmation Code is: ${code}</p>`;
    },
  },
};

sendCode(data);

// To verify the code validity

const response = verifyCode("[email protected]", 3429921);

// To verify with the Token code

const response = verifyToken("CunedqBnbxT85jbXLrApHh");

// To verify with both codes

const codes = {
  code: 3429921,
  token: "CunedqBnbxT85jbXLrApHh",
};

const response = verifyBoth(codes);

console.log(response);

smtpInfo

| Option | Type | Default | Description | Required | | ------ | ------ | ------- | --------------------------------------------------------------- | -------- | | host | String | null | SMTP HOST, required to Connect to Your SMTP & Send the mail | True | | port | Number | 587 | SMTP PORT, required to Connect to Your SMTP & Send the mail | True | | user | String | null | SMTP User, required to Connect to Your SMTP & Send the mail | True | | pass | String | null | SMTP Password, required to Connect to Your SMTP & Send the mail | True |

company

| Option | Type | Default | Description | Required | | ------ | ------ | ------- | ---------------------------------------- | ---------------------------------- | | name | String | null | Your company Name, sent in the FROM tag | false, One of the two is Required. | | email | String | null | Your company email, sent in the from tag | false, One of the two is Required. |

mailInfo

| Option | Type | Default | Description | Required | | ------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | | emailReceiver | String | null | User or Receiver Email | True | | subject | String | null | The mail Subject | False | | text | Function | '' | The mail content.NB: This function must have two parameters which corresponds to the Code & the Token | False, One of the two is Required. | | html | Function | '' | The mail content.NB: This function must have two parameters which corresponds to the Code & the Token | False, One of the two is Required. |

How it Work!

The script generates a 6-digit & a token codes with 1 hour validity and saves it locally (For security reasons, please call the backend functions) and then sends an email with the message you had inserted previously.

To check the code, all you need to do is have the email address and the code. The script will look for the code in the local database, compare it, delete it if the code is correct, and give you a response to do so.

License

MIT