# sendgrid-stub

> A sendgrid stub which sends and reads emails locally for testing

Latest version **0.0.3** (published 2013-11-11) · Creative Commons Attribution 3.0 Unported  license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install sendgrid-stub
pnpm add sendgrid-stub
yarn add sendgrid-stub
bun add sendgrid-stub
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2013-11-11 |
| First published | 2013-03-14 |
| Weekly downloads | 0 |
| License | Creative Commons Attribution 3.0 Unported  |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.6 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Vincens Riber Mink |
| Maintainers | ExxKA |

## Links

- npm: https://www.npmjs.com/package/sendgrid-stub
- Repository: https://github.com/VRMink/sendgrid-stub
- npm.io page: https://npm.io/package/sendgrid-stub

## Dependencies (2)

- [async](https://npm.io/package/async.md) 0.1.16
- [underscore](https://npm.io/package/underscore.md) 1.4.3

## Recent versions

- 0.0.3 (latest) — 2013-11-11
- 0.0.2 — 2013-03-14

## README

sendgrid-stub
=============

A node.js stub for the SendGrid library - this lets you send and receive emails locally during testing

Usage
-----
Install
    
    npm install sendgrid-stub
Use
    
    var MailClient = require('sendgrid-stub').MailClient;
    var SendGrid = require('sendgrid-stub').SendGrid;
    var localAppserverMailClient = new MailClient("./sendgridEmails/");
    var sendgrid = new SendGrid("username", "password");

    //Send the email
    sendgrid.send({
		to: "receiver@example.com",
		from: "hello@example.com",
		subject: "Test mail",
		html: "<b>Content</b>"
		text: "Content"
	}, callback);

	//Receive it again
	localAppserverMailClient.getLatest(function(err, email){
		console.log(email);
	}

	//Purge inbox
	localDashboardMailClient.deleteAll(function(){
		console.log("Deleted")
	})

Background
----------
I use this mock for testing webapps which make use of the SendGrid service. Just replace the sendgrid library with this stub, and pick up your e-mails with the mail client from: process.cwd()+"/sendgridEmails/"

All emails are written to disk as json objects.

---
_Source: https://npm.io/package/sendgrid-stub · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
