feat: add email helper module using useSend SDK

This commit is contained in:
Sanju Sivalingam
2026-02-18 22:38:30 +05:30
parent 8748e7a28b
commit 7125aed49f
2 changed files with 25 additions and 0 deletions

View File

@@ -3,3 +3,6 @@ DATABASE_URL="postgres://user:password@host:port/db-name"
SERVER_URL="http://localhost:8080" SERVER_URL="http://localhost:8080"
PUBLIC_SERVER_WS_URL="ws://localhost:8080" PUBLIC_SERVER_WS_URL="ws://localhost:8080"
# Email (useSend)
USESEND_API_KEY="us_your_api_key_here"

View File

@@ -0,0 +1,22 @@
import { UseSend } from 'usesend-js';
const usesend = new UseSend(process.env.USESEND_API_KEY!);
const EMAIL_FROM = 'noreply@app.droidclaw.ai';
export async function sendEmail({
to,
subject,
text
}: {
to: string;
subject: string;
text: string;
}) {
return usesend.emails.send({
to,
from: EMAIL_FROM,
subject,
text
});
}