AIGCS

Email & Notifications

Email configuration and notification system

Overview

AIGCS uses SMTP for email notifications. Email is optional — the system works without it.

SMTP Configuration

Configure in Settings → SMTP in the admin panel:

FieldDescription
HostSMTP server hostname
PortSMTP port (default: 587)
UserSMTP username or full email
PasswordSMTP password (encrypted at rest via AES-256-GCM)
From EmailSender email address
From NameSender display name

Environment Variables

SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=noreply@example.com
SMTP_PASS=your-password

Email Language

Set the email locale (en or zh) in Settings → SMTP → Email Language. This controls the language of all notification emails — subject lines and body content are fully bilingual.

Testing

Click Send Test Email in the admin panel to verify your SMTP configuration.

Email Templates

AIGCS includes 6 built-in Handlebars email templates, available in both English and Chinese:

TemplateTrigger
welcomeNew user registration
comment-generatedAI comments generated for a page
new-commentVisitor submits a comment
reply-notificationReply to a visitor's comment
delete-codeVerification code for comment deletion
rss-importRSS import completion report

Customizing Templates

Templates use Handlebars syntax and can be customized:

<h2>New AI Comments Generated</h2>
<p>Page: {{pageTitle}}</p>
<p>URL: {{pageUrl}}</p>
<p>Comments generated: {{commentCount}}</p>

Available context variables vary by template.

Notification Events

EventDeliveryDescription
Comments GeneratedEmail + WebhookAI comments created for a page
New Visitor CommentEmailVisitor submits a comment
Reply ReceivedEmailReply to visitor's comment
RSS Import CompleteWebhookRSS batch import finished

Unsubscribe System

Each notification email includes an unsubscribe link.

GET /api/unsubscribe?email=user@example.com&ctx=site_123&token=<hmac>
  • Uses HMAC-SHA256 signed tokens
  • Supports per-email + per-context unsubscription
  • Toggle: clicking unsubscribe again re-subscribes

On this page