Skip to content

Commit 39ab6f7

Browse files
committed
docs(mailer): refresh docs for ci and test flow 📖
- Add changelog with release notes and recent updates - Add ci badge and env based testing instructions in readme - Expand usage guide with encoding and embedded disposition examples
1 parent 0c4a901 commit 39ab6f7

3 files changed

Lines changed: 145 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Added test suite under `tests/` covering:
13+
SMTP address parsing, SMTP connection behavior, SMTP message formatting,
14+
calendar formatting, and utility validation helpers
15+
- Added integration test coverage for real SMTP send flows:
16+
plain text, HTML, attachments, embedded images, calendar invite,
17+
mixed recipients, custom headers, and secure TLS transport
18+
- Added test environment setup examples in `README.md` using `.env` and shell exports
19+
20+
### Changed
21+
22+
- Sorted test case descriptions in ascending A-Z order for consistency
23+
- Improved several test descriptions to be clearer and more specific
24+
- Expanded `USAGE.md` with attachment encoding options (`base64`, `7bit`, `quoted-printable`)
25+
and embedded image disposition options (`inline`, `attachment`)
26+
- Updated `README.md` features to mention transfer encoding support
27+
28+
## [0.1.0] - 2025-10-22
29+
30+
### Added
31+
32+
- Initial public release of `@neabyte/deno-mailer`
33+
- SMTP email client with transporter API and message sender interface
34+
- Core email capabilities: plain text, HTML, mixed body, and custom headers
35+
- Flexible recipient handling for string, object, and mixed address formats
36+
- Attachment and embedded image support with MIME multipart formatting
37+
- Calendar invite support through generated iCalendar payloads
38+
- SMTP connection flow with STARTTLS and TLS transport options
39+
- SMTP authentication support with LOGIN and PLAIN mechanisms
40+
- Utility modules for SMTP config, attachment, content-id, and email validation
41+
- JSR publish workflow and package metadata setup
42+
43+
### Changed
44+
45+
- Refactored SMTP modules to align naming and documentation
46+
- Refactored utility modules to unify imports and content helper naming
47+
- Updated docs split between `README.md` and `USAGE.md`
48+
- Updated `@std/assert` dependency import version
49+
50+
[Unreleased]: https://github.com/NeaByteLab/Deno-Mailer/compare/9618b63...HEAD
51+
[0.1.0]: https://github.com/NeaByteLab/Deno-Mailer/commit/9618b63

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Lightweight Deno SMTP mailer with flexible configuration and formatting.
66

7-
[![Deno](https://img.shields.io/badge/deno-%3E%3D2.x-000000?logo=deno&logoColor=white)](https://deno.com) [![JSR](https://jsr.io/badges/@neabyte/deno-mailer)](https://jsr.io/@neabyte/deno-mailer) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7+
[![Deno](https://img.shields.io/badge/deno-%3E%3D2.x-000000?logo=deno&logoColor=white)](https://deno.com) [![JSR](https://jsr.io/badges/@neabyte/deno-mailer)](https://jsr.io/@neabyte/deno-mailer) [![CI](https://github.com/NeaByteLab/Deno-Mailer/actions/workflows/ci.yml/badge.svg)](https://github.com/NeaByteLab/Deno-Mailer/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
88

99
</div>
1010

@@ -14,6 +14,7 @@ Lightweight Deno SMTP mailer with flexible configuration and formatting.
1414
- **Flexible recipients**: supports string, object, and mixed recipient formats
1515
- **Rich message content**: plain text, HTML, mixed body, and custom headers
1616
- **Attachments and inline media**: supports file attachments and embedded images
17+
- **Transfer control options**: supports base64, 7bit, and quoted-printable encodings
1718
- **Calendar invitations**: generates ICS calendar payload for meeting invites
1819
- **Zero external runtime deps**: built with Deno native capabilities
1920

@@ -58,9 +59,34 @@ await transporter.send({
5859
deno task check
5960
```
6061

62+
## Test
63+
64+
```bash
65+
# Copy env template for SMTP integration tests.
66+
cp .env.example .env
67+
```
68+
69+
```bash
70+
# Set ETHEREAL_USER and ETHEREAL_PASS in .env, then run test suite.
71+
deno task test
72+
```
73+
74+
```bash
75+
# Alternative: export credentials in shell, then run test suite.
76+
export ETHEREAL_USER=your-ethereal-username
77+
export ETHEREAL_PASS=your-ethereal-password
78+
79+
# Optional: run secure TLS (port 465) integration test too.
80+
export RUN_SECURE_SMTP_TEST=true
81+
82+
# Run full unit and integration tests.
83+
deno task test
84+
```
85+
6186
## Reference
6287

6388
- [USAGE.md](USAGE.md): complete API usage, configuration, and troubleshooting
89+
- [CHANGELOG.md](CHANGELOG.md): release history and notable changes
6490

6591
## Contributing
6692

USAGE.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ This document explains the full **Deno Mailer** usage flow, from SMTP configurat
1717
- [Advanced Recipient Formats](#advanced-recipient-formats)
1818
- [Advanced Features](#advanced-features)
1919
- [File Attachments](#file-attachments)
20+
- [Attachment Encoding Options](#attachment-encoding-options)
2021
- [Embedded Images](#embedded-images)
22+
- [Embedded Image Disposition](#embedded-image-disposition)
2123
- [Calendar Invitations](#calendar-invitations)
2224
- [Custom Headers](#custom-headers)
2325
- [API Reference](#api-reference)
@@ -182,6 +184,38 @@ await transporter.send({
182184
})
183185
```
184186

187+
### Attachment Encoding Options
188+
189+
```ts
190+
// Use base64, 7bit, or quoted-printable transfer encoding.
191+
await transporter.send({
192+
from: 'sender@example.com',
193+
to: 'recipient@example.com',
194+
subject: 'Attachment Encoding Options',
195+
text: 'Different transfer encodings are supported',
196+
attachments: [
197+
{
198+
filename: 'base64.txt',
199+
content: fileBase64Content,
200+
contentType: 'text/plain',
201+
encoding: 'base64'
202+
},
203+
{
204+
filename: 'plain.txt',
205+
content: 'Plain text body',
206+
contentType: 'text/plain',
207+
encoding: '7bit'
208+
},
209+
{
210+
filename: 'qp.txt',
211+
content: 'Quoted printable body',
212+
contentType: 'text/plain',
213+
encoding: 'quoted-printable'
214+
}
215+
]
216+
})
217+
```
218+
185219
```ts
186220
// Send multiple attachments with mixed content types.
187221
await transporter.send({
@@ -233,6 +267,36 @@ await transporter.send({
233267
})
234268
```
235269

270+
### Embedded Image Disposition
271+
272+
```ts
273+
// Set inline or attachment disposition for embedded images.
274+
await transporter.send({
275+
from: 'sender@example.com',
276+
to: 'recipient@example.com',
277+
subject: 'Embedded Image Disposition',
278+
html: '<h1>Hello!</h1><img src="cid:logo">',
279+
embeddedImages: [
280+
{
281+
filename: 'logo.png',
282+
content: imageContent,
283+
contentType: 'image/png',
284+
cid: '<logo@example.com>',
285+
disposition: 'inline',
286+
encoding: 'base64'
287+
},
288+
{
289+
filename: 'badge.png',
290+
content: badgeContent,
291+
contentType: 'image/png',
292+
cid: '<badge@example.com>',
293+
disposition: 'attachment',
294+
encoding: 'base64'
295+
}
296+
]
297+
})
298+
```
299+
236300
### Calendar Invitations
237301

238302
```ts
@@ -329,6 +393,9 @@ await transporter.send({
329393
| `calendarEvent` | object | no | Calendar invitation |
330394
| `headers` | object | no | Custom email headers |
331395

396+
Attachment and embedded image encoding supports `base64`, `7bit`, and `quoted-printable`.
397+
Embedded image disposition supports `inline` and `attachment`.
398+
332399
### Error Handling
333400

334401
```ts

0 commit comments

Comments
 (0)