https://github.com/levinunnink/batch-markdown-email
Send markdown newsletters using Postmark
https://github.com/levinunnink/batch-markdown-email
email markdown postmark
Last synced: 9 months ago
JSON representation
Send markdown newsletters using Postmark
- Host: GitHub
- URL: https://github.com/levinunnink/batch-markdown-email
- Owner: levinunnink
- License: mit
- Created: 2025-04-08T02:05:28.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-04-08T02:31:37.000Z (9 months ago)
- Last Synced: 2025-04-08T03:25:01.919Z (9 months ago)
- Topics: email, markdown, postmark
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/batch-markdown-email
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Batch Markdown Email
[](https://www.npmjs.com/package/batch-markdown-email)
A CLI tool for sending markdown-based newsletters via Postmark. This tool converts a Markdown file into HTML and sends it as an email newsletter to a list of recipients using Postmark's batch API.
## Features
- **Secure Credentials:** Uses [keytar](https://github.com/atom/node-keytar) to securely store your Postmark API credentials and broadcast stream.
- **Markdown to HTML:** Converts Markdown files to HTML using [markdown-it](https://github.com/markdown-it/markdown-it).
- **CSV Parsing:** Reads recipient emails from a CSV file.
- **Batch Processing:** Automatically splits messages into batches of up to 500 to comply with Postmark limits.
- **CLI Commands:** Offers `validate` and `send` commands for configuration testing and sending emails.
## Installation
Install the package globally from npm:
```bash
npm install -g batch-markdown-email
```
## Usage
The CLI provides two commands: `validate` and `send`.
## Send
The send command sends your newsletter via Postmark. You can optionally provide the --apiKey and --broadcastStream flags; if omitted, you’ll be prompted to enter them.
```bash
batch-markdown-email send --markdown ./path/to/newsletter.md --subject "Your Subject" --to ./path/to/recipients.csv [--apiKey YOUR_POSTMARK_API_KEY] [--broadcastStream YOUR_FROM_EMAIL]
```
You should format your email csv like this:
```csv
Emails
test@email.com
test2@email.com
"Testing Name"
```
## Development
Clone the repository and install dependencies:
```bash
git clone https://github.com/yourusername/batch-markdown-email.git
cd batch-markdown-email
npm install
```
## Building
Compile the TypeScript source code to JavaScript:
```bash
npm run build
```
### Testing
You can test the CLI commands locally using:
```bash
npm run validate -- --markdown ./path/to/newsletter.md --subject "Test Subject" --to ./path/to/recipients.csv
npm run send -- --markdown ./path/to/newsletter.md --subject "Test Subject" --to ./path/to/recipients.csv
```
### License
This project is licensed under the MIT License.