Skip to content

parcelwing/parcelwing-rust-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parcel Wing Rust Example App

A tiny Rust web app that demonstrates sending a test email with the official parcelwing Rust SDK from crates.io.

It is intentionally small enough to use as both:

  1. A real-world smoke test for the Parcel Wing Rust SDK.
  2. A starter example for developers who want to send their first email from Rust.

What it includes

  • Axum web server
  • Official parcelwing SDK from crates.io
  • Browser form for entering an API key, sender, recipient, subject, and message body
  • Optional .env support without adding an extra dotenv dependency
  • Lightweight custom UI
  • JSON response panel for queued emails or API errors

Requirements

  • Rust 1.75 or newer
  • A Parcel Wing API key
  • A verified sending domain in Parcel Wing

Quick start

cargo run

Then open:

http://localhost:8080

Paste your Parcel Wing API key, fill in the sender and recipient fields, and send a test email.

Environment variables

Copy the example env file:

cp .env.example .env

Then edit:

PARCELWING_API_KEY=pw_live_your_api_key_here
PARCELWING_BASE_URL=https://parcelwing.com
PORT=8080

The app still lets you override the API key and base URL from the UI. API keys are only used by the local server for the current request and are not stored by the app.

Project structure

.
├── src
│   ├── env.rs
│   └── main.rs
├── static
│   └── styles.css
├── .env.example
├── .gitignore
├── Cargo.toml
├── LICENSE
└── README.md

Notes

  • The browser posts the form to this local Rust server.
  • The server creates a Parcel Wing SDK client.
  • The SDK queues the email through client.emails().send(...).

About

Rust example app for sending test emails with the official Parcel Wing SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors