Skip to content

Creates a link to the webmail inbox based on email address.

License

Notifications You must be signed in to change notification settings

Rjs37/link-to-inbox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

link-to-inbox

Creates a link to the webmail inbox based on email address.

Install

npm install link-to-inbox

Usage

Get the HTML link tag

Without filters

var link = linkToInbox.createLink('[email protected]');
// '<a href="https://mail.google.com/mail/u/0/" target="_blank">Check your Gmail inbox</a>'

With filters

var link = linkToInbox.getHref('[email protected]', {subject: 'Confirm your account'});
// '<a href="https://mail.google.com/mail/u/0/#search/in%3Aanywhere+subject%3A%Confirm%252520your%252520account%22" target="_blank">Check your Gmail inbox</a>'

With custom link text

var link = linkToInbox.getHref('[email protected]', {subject: 'Confirm your account'}, 'Open in %s');
// '<a href="https://mail.google.com/mail/u/0/#search/in%3Aanywhere+subject%3A%Confirm%252520your%252520account%22" target="_blank">Open in Gmail</a>'

Just get the link

Without filters

var link = linkToInbox.getHref('[email protected]');
// 'https://mail.google.com/mail/u/0/'

With filters

var link = linkToInbox.getHref('[email protected]', {subject: 'Confirm your account'});
// 'https://mail.google.com/mail/u/0/#search/in%3Aanywhere+subject%3A%Confirm%252520your%252520account%22'

Credits

This JS module is based on the ideas in the following articles:

About

Creates a link to the webmail inbox based on email address.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 67.6%
  • HTML 32.4%