Skip to content
PDF to Mail. Send US certified mail in one API call
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.editorconfig
.eslintignore
.eslintrc
.gitignore
.npmignore
README.md
package.json

README.md

P2M


P2M   |   Ideea.io   |   Full Documentation   |   NPM


P2M

P2M (PDF 2 Mail) is an API for sending certified mail. Simply use the .send() method to upload a PDF along with your recipient's address and we will print and send it as certified US mail. Use this API to verify your customers physical address or send legal documents for signing. Monitor the status of your mail by using the webhook feature that will even send you the recipients signature once successfully delivered.

Installation

$ npm install p2m-js

Getting Started

const P2M = require('p2m-js');
const fs = require('fs');

var p2m = new P2M('YOUR_API_KEY');

p2m.mail.send({
    // PDF File
    pdf: fs.readFileSync('./document.pdf'),

    // Optioinal. Recive webhooks as your mail goes from printed to dispatched to delivered.
    webhook: 'https://example.com/webhoook', 

    // Address of recipient
    name: 'John Smith',
    address_line_1: 'Apt 123',
    address_line_2: '456 Long Street',
    zipcode: '78703',
    city: 'Austin',
    state: 'TX',
}).then(function (mail) {
	console.log(`Your PDF will arrive in the mail on ${mail.estimated_delivery_date}`);
})
You can’t perform that action at this time.