Event-driven email microservice. NATS + Resend integration. Multi-arch. Minimal footprint.
316
A lightweight, production-ready email microservice that integrates seamlessly with NATS messaging and Resend API. Built with Go for high performance and minimal resource footprint.
docker run -d \
--name emailsvc \
-e NATS_URL=nats://your-nats-server:4222 \
-e EMAIL_KEY=re_your_resend_api_key \
-e [email protected] \
-e [email protected] \
carfdev/carfdev-emailsvc:latest
linux/amd64 and linux/arm64| Variable | Description | Required | Default |
|---|---|---|---|
NATS_URL | NATS server connection URL | No | nats://localhost:4222 |
EMAIL_KEY | Resend API key | Yes | - |
EMAIL_FROM | Sender email address | No | [email protected] |
EMAIL_ADMIN | Admin email for notifications | No | [email protected] |
SERVICE_NAME | Service identifier | No | emailsvc |
ENV | Environment (dev/prod) | No | dev |
email.send_contactSend contact form emails to administrators.
Request:
{
"FirstName": "John",
"LastName": "Doe",
"Email": "[email protected]",
"CompanyName": "Acme Corp",
"ProjectType": "Web Development",
"Budget": "$10,000 - $25,000",
"Message": "We need help with..."
}
Response:
{
"data": {
"status": 200,
"message": "Email sent, ID: abc123xyz"
}
}
version: '3.8'
services:
nats:
image: nats:latest
ports:
- "4222:4222"
emailsvc:
image: carfdev/carfdev-emailsvc:latest
environment:
- NATS_URL=nats://nats:4222
- EMAIL_KEY=${RESEND_API_KEY}
- [email protected]
- [email protected]
- ENV=production
depends_on:
- nats
restart: unless-stopped
apiVersion: apps/v1
kind: Deployment
metadata:
name: emailsvc
spec:
replicas: 2
selector:
matchLabels:
app: emailsvc
template:
metadata:
labels:
app: emailsvc
spec:
containers:
- name: emailsvc
image: carfdev/carfdev-emailsvc:latest
env:
- name: NATS_URL
value: "nats://nats-service:4222"
- name: EMAIL_KEY
valueFrom:
secretKeyRef:
name: email-secrets
key: resend-api-key
- name: EMAIL_FROM
value: "[email protected]"
- name: EMAIL_ADMIN
value: "[email protected]"
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "64Mi"
cpu: "100m"
MIT License - see repository for details
carfdev - Building cloud-native microservices
Tags: email, microservice, nats, golang, resend, docker, kubernetes, cloud-native
Content type
Image
Digest
sha256:634c081bcβ¦
Size
5.4 MB
Last updated
12 months ago
docker pull carfdev/carfdev-emailsvc