Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dylanon/mailer
Handle email contact forms - serverless!
https://github.com/dylanon/mailer
Last synced: about 1 month ago
JSON representation
Handle email contact forms - serverless!
- Host: GitHub
- URL: https://github.com/dylanon/mailer
- Owner: dylanon
- Created: 2019-10-26T22:51:24.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T01:11:17.000Z (over 3 years ago)
- Last Synced: 2024-11-04T08:42:19.372Z (3 months ago)
- Language: TypeScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mailer
Email form serverless function built for [Zeit Now](https://github.com/zeit/now) and Dreamhost's email service.
## Setup
### Add secrets
The Dreamhost-hosted email address that messages will be sent from (your "mailer" address):
```bash
npx now secrets add namespace-mail-user [email protected]
```The password for that email address:
```bash
npx now secrets add namespace-mail-pass yourpasswordhere
```The email address that messages will be sent to:
```bash
npx now secrets add namespace-mail-send-to [email protected]
```### Deploy to Now
```bash
yarn deploy:prod
```## Usage
### POST /api/contact
```javascript
fetch('https://yourdomainhere.com/api/contact', {
method: 'POST',
body: JSON.stringify({
message: 'Just wanted to say hi!',
senderEmail: '[email protected]',
senderName: 'Some Sender',
subject: 'Hello world'
})
});
```