Skip to content

WebReflection/static.email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StaticEmail

Build Status Coverage Status License: ISC

The easiest way to send emails to yourself, as described in this post.

Back End

Publish a static website via zeit now, use static.email.ses as serverless function and call it a day 🎉

Client Side

Either import StaticEmail from 'static.email' or put the script on top of your page.

<script src="https://unpkg.com/static.email"></script>
<script>
StaticEmail({
  // your zeit now SES enabled serverless function
  path: '/api/paperboy',

  // optional fields
  from: 'Some Body <some@body.me>',
  subject: 'Is it really that simple?',

  // allowed content
  html: '<strong>Great Service!</strong>',
  md: '# Great Service!',
  text: 'Great Service'
})
  .then(() => console.log('email sent 🎉'))
  .catch(console.error);
</script>