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

https://github.com/feryardiant/sendgrid-inbound-parser

Simple library to parse SendGrid Inbound Mail
https://github.com/feryardiant/sendgrid-inbound-parser

inbound-email sendgrid sendgrid-inbound-webhook-parser

Last synced: about 1 year ago
JSON representation

Simple library to parse SendGrid Inbound Mail

Awesome Lists containing this project

README

          

# Sendgrid Inbound Parser

My personal implementation of SendGrid inbound-mail parser.

## Usage

This package exposes 4 functions

### `async parseEmail(req): Promise`
Parse email field in inbound mail body.

### `async storeAttachment(attachment, bucket): Promise`
Store the attachment file to google storage bucket.

### `normalize(email): NormalizedEmail`
Normalize parsed-mail from 'mailparser' package

### `inboundParser()`
Express middleware to parse request body.

---
Please refer to [this file](dist/index.d.ts) for more type definitions

## Credits

- Official inbound-mail parser [@sendgrid/inbound-mail-parser](https://www.npmjs.com/package/@sendgrid/inbound-mail-parser)

## Licenses
code is licensed under [MIT](./LICENSE),