AtlatestRepositorysigil-ses
1# sigil-ses
2
3A Sigil library for the [Amazon SES v2](https://docs.aws.amazon.com/ses/latest/APIReference-V2/) API. Send email, manage suppression lists, and parse bounce/complaint notifications.
4
5## Features
6
7- **Send email** -- simple text/HTML emails with To/Cc/Bcc/Reply-To support
8- **Bulk email** -- send to multiple recipients with template substitution
9- **Suppression list** -- add, remove, query, and list suppressed addresses
10- **Account info** -- sending quota, daily usage, enforcement status
11- **Identity verification** -- check domain/email DKIM and MAIL FROM status
12- **Bounce/complaint parsing** -- stateless SNS notification parsing with typed records
13- **AWS SigV4 signing** -- full implementation of AWS Signature Version 4
15## Usage
17```scheme
18(import (amazon ses))
20;; Create a client (defaults to us-east-2 region)
21(define client (ses-client access-key-id: "AKIA..."
22 secret-access-key: "wJalr..."))
24;; Send a simple email
25(ses-send-email client
28 "Hello from Sigil"
29 "This is the plain text body."
30 html: "<h1>Hello from Sigil</h1><p>HTML body here.</p>"
31 reply-to: "[email protected]")
33;; Send to multiple recipients
34(ses-send-email client
37 "Newsletter #42"
38 "Plain text content."
39 html: "<p>Newsletter content.</p>"
42;; Check account quota
43(let ((acct (ses-get-account client)))
44 (display (ses-account-send-quota acct))
45 (display (ses-account-sent-last-24h acct)))
47;; Manage suppression list
48(ses-put-suppressed client "[email protected]" "BOUNCE")
49(ses-list-suppressed client)
50(ses-delete-suppressed client "[email protected]")
52;; Check domain identity
53(let ((id (ses-get-identity client "systemcrafters.net")))
54 (ses-identity-verified? id)
55 (ses-identity-dkim-status id))
56```
58## Bounce/Complaint Notifications
60Parse SNS notifications from SES:
62```scheme
63(import (amazon ses notify))
65;; In your webhook handler, parse the SNS JSON body:
66(let ((notif (parse-ses-notification json-body)))
67 (when notif
68 (cond
69 ((ses-hard-bounce? notif)
70 ;; Remove permanently bounced addresses
71 (for-each remove-subscriber (ses-notification-addresses notif)))
72 ((ses-complaint? notif)
73 ;; Unsubscribe complainers
74 (for-each unsubscribe (ses-notification-addresses notif))))))
75```
77## Configuration
79SES requires AWS credentials with `ses:SendEmail` and related IAM permissions.
81Environment variables (load with your preferred method):
82- `AWS_ACCESS_KEY_ID`
83- `AWS_SECRET_ACCESS_KEY`
84- `AWS_REGION` (optional, defaults to us-east-2)
86## Dependencies
88- sigil-stdlib
89- sigil-http
90- sigil-json
91- sigil-crypto
93## Building
95```bash
96sigil deps install
97sigil build
98sigil test
99```
101## License
103BSD-3-Clause