Unlisted
Like
send-lead-gen-email
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v49View latest version
A Hono-based web application for previewing and sending personalized welcome emails with Discord notifications.
This Val provides a user-friendly interface to preview and send customized welcome emails to new users. It's designed to integrate with automation workflows (like Discord bots or webhooks) where you can generate quick links for team members to review and approve emails before sending.
- 📧 Email Preview - Visual preview of the email before sending
- ✏️ Inline Editing - Quick edit capability for subject and content
- 🎨 Personalization - Dynamic email content based on user data
- 🔔 Discord Notifications - Automatic Discord webhook on successful send
- 🔗 Edit Val Button - Quick access to edit the Val code
- 📱 Responsive Design - Works on desktop and mobile
Generate a URL with the following query parameters:
https://send-lead-gen-email.val.run?name=John+Doe&email=john@example.com&title=Software+Engineer&org=Acme+Corp
name: Full name of the recipient (e.g., "John Doe")email: Email address of the recipient
title: Job title (e.g., "Software Engineer")org: Organization/company name (e.g., "Acme Corp")
The role description in the email is automatically built from
the title and org parameters:
- Both provided: "your role as Software Engineer at Acme Corp"
- Only title: "your role as Software Engineer"
- Only org: "your work at Acme Corp"
- Neither: "your background"
Set these in your Val Town environment:
GMAIL_USER- Gmail address for sending emailsGMAIL_PASS- Gmail app password (not your regular password)
DISCORD_WEBHOOK- Discord webhook URL for notifications
Edit the email content by modifying these files:
- email.html - HTML version of the email
- email.txt - Plain text version of the email
Use these template variables:
{{firstName}}- First name extracted from full name{{roleDescription}}- Auto-generated role description{{subject}}- Email subject line
.
├── main.ts # Hono server and routes
├── email-template.ts # Email generation logic
├── pages.ts # HTML page templates
├── discord.ts # Discord webhook notifications
├── email.html # Email HTML template
├── email.txt # Email text template
└── README.md # This file
When an email is successfully sent, a Discord notification is posted with:
- ✅ Success message with recipient details
- 📧 Email preview embed (subject + body)
- ✏️ Edit Val button to modify the code
generateEmailPreview()- Generates email content from templatesbuildRoleDescription()- Creates personalized role descriptionssendDiscordNotification()- Sends Discord webhook on email sendgeneratePreviewPage()- Renders the preview UI