Add email verification system for user registration
All checks were successful
Build And Push Image / docker (push) Successful in 3m1s
All checks were successful
Build And Push Image / docker (push) Successful in 3m1s
- Add SMTP configuration UI in admin panel with test functionality - Implement email verification workflow with tokens and templates - Add verification success/expired pages for user feedback - Include nodemailer, handlebars, and JWT dependencies - Create API endpoints for email config, testing, and verification
This commit is contained in:
216
server/templates/test.hbs
Normal file
216
server/templates/test.hbs
Normal file
@@ -0,0 +1,216 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>SMTP Test Email</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.email-container {
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 2px solid #a31515;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #a31515;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
|
||||
.success-badge {
|
||||
background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.test-details {
|
||||
background: #f8f9fa;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
border-left: 4px solid #a31515;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.test-details h3 {
|
||||
color: #a31515;
|
||||
margin: 0 0 15px 0;
|
||||
}
|
||||
|
||||
.detail-row {
|
||||
display: flex;
|
||||
margin-bottom: 8px;
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-weight: bold;
|
||||
min-width: 120px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
color: #333;
|
||||
font-family: 'Courier New', monospace;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #eee;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: #a31515;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.email-container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.detail-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
min-width: auto;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="email-container">
|
||||
<div class="header">
|
||||
<img src="{{logoUrl}}" alt="MonacoUSA" class="logo">
|
||||
<h1 class="title">SMTP Test Email</h1>
|
||||
<p class="subtitle">Email Configuration Test</p>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<div class="success-badge">
|
||||
✅ SMTP Configuration Working!
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Congratulations! This test email confirms that your SMTP email configuration is working correctly. The MonacoUSA Portal email system is now ready to send emails.</p>
|
||||
|
||||
<div class="test-details">
|
||||
<h3>📊 Test Configuration Details</h3>
|
||||
|
||||
<div class="detail-row">
|
||||
<div class="detail-label">Test Time:</div>
|
||||
<div class="detail-value">{{testTime}}</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-row">
|
||||
<div class="detail-label">SMTP Host:</div>
|
||||
<div class="detail-value">{{smtpHost}}</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-row">
|
||||
<div class="detail-label">From Address:</div>
|
||||
<div class="detail-value">{{fromAddress}}</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-row">
|
||||
<div class="detail-label">Email Type:</div>
|
||||
<div class="detail-value">SMTP Configuration Test</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>🎯 What This Means</h3>
|
||||
<ul>
|
||||
<li><strong>✅ Connection Established:</strong> Successfully connected to your SMTP server</li>
|
||||
<li><strong>✅ Authentication Passed:</strong> SMTP credentials are correct and working</li>
|
||||
<li><strong>✅ Email Delivery:</strong> Emails can be sent from the portal</li>
|
||||
<li><strong>✅ Template System:</strong> Email templates are loading and rendering correctly</li>
|
||||
</ul>
|
||||
|
||||
<h3>📧 Available Email Types</h3>
|
||||
<p>Your portal can now send the following types of emails:</p>
|
||||
<ul>
|
||||
<li><strong>Welcome Emails:</strong> New member registration confirmations</li>
|
||||
<li><strong>Email Verification:</strong> Account activation links</li>
|
||||
<li><strong>Password Reset:</strong> Secure password reset instructions</li>
|
||||
<li><strong>Dues Reminders:</strong> Membership payment notifications</li>
|
||||
<li><strong>General Notifications:</strong> Administrative communications</li>
|
||||
</ul>
|
||||
|
||||
<div style="background: rgba(40, 167, 69, 0.1); padding: 15px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #28a745;">
|
||||
<p style="margin: 0; color: #155724;">
|
||||
<strong>✨ Success!</strong> Your email system is fully configured and operational.
|
||||
All automated emails from the MonacoUSA Portal will now be delivered successfully.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p><strong>MonacoUSA Portal</strong><br>
|
||||
Email System Configuration Test</p>
|
||||
|
||||
<p>
|
||||
<a href="https://portal.monacousa.org" class="link">Portal</a> |
|
||||
<a href="mailto:admin@monacousa.org" class="link">Admin Support</a>
|
||||
</p>
|
||||
|
||||
<p style="margin-top: 20px; font-size: 12px; color: #999;">
|
||||
This is an automated test email to verify SMTP configuration.<br>
|
||||
Generated by MonacoUSA Portal Email System
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
219
server/templates/welcome.hbs
Normal file
219
server/templates/welcome.hbs
Normal file
@@ -0,0 +1,219 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Welcome to MonacoUSA</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.email-container {
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 2px solid #a31515;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #a31515;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.greeting {
|
||||
font-size: 20px;
|
||||
color: #a31515;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.member-info {
|
||||
background: #f8f9fa;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
border-left: 4px solid #a31515;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.member-info h3 {
|
||||
color: #a31515;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.verify-button {
|
||||
display: inline-block;
|
||||
padding: 15px 30px;
|
||||
background: linear-gradient(135deg, #a31515 0%, #c41e1e 100%);
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 8px;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin: 20px 0;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.verify-button:hover {
|
||||
background: linear-gradient(135deg, #8b1212 0%, #a31515 100%);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(163, 21, 21, 0.3);
|
||||
}
|
||||
|
||||
.payment-info {
|
||||
background: rgba(163, 21, 21, 0.05);
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(163, 21, 21, 0.1);
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.payment-info h3 {
|
||||
color: #a31515;
|
||||
margin: 0 0 15px 0;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #eee;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: #a31515;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.email-container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.verify-button {
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="email-container">
|
||||
<div class="header">
|
||||
<img src="{{logoUrl}}" alt="MonacoUSA" class="logo">
|
||||
<h1 class="title">Welcome to MonacoUSA</h1>
|
||||
<p class="subtitle">Monaco - United States Association</p>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="greeting">
|
||||
Dear {{firstName}} {{lastName}},
|
||||
</div>
|
||||
|
||||
<p>Thank you for registering to become a member of the <strong>MonacoUSA Association</strong>! We're excited to welcome you to our community that bridges Monaco and the United States.</p>
|
||||
|
||||
<div class="member-info">
|
||||
<h3>🎉 Registration Successful</h3>
|
||||
<p><strong>Member ID:</strong> {{memberId}}</p>
|
||||
<p><strong>Registration Date:</strong> {{registrationDate}}</p>
|
||||
<p>Your membership application has been received and is being processed.</p>
|
||||
</div>
|
||||
|
||||
<h3>📧 Next Step: Verify Your Email</h3>
|
||||
<p>To complete your registration and activate your account, please verify your email address by clicking the button below:</p>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<a href="{{verificationLink}}" class="verify-button">
|
||||
✉️ Verify Email Address
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<p><em>This verification link will expire in 24 hours for security purposes.</em></p>
|
||||
|
||||
<div class="payment-info">
|
||||
<h3>💳 Membership Dues Payment</h3>
|
||||
<p>Once your email is verified, you'll be able to log in to the portal. To activate your membership, please transfer your annual membership dues:</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Amount:</strong> €50/year</li>
|
||||
<li><strong>Payment method:</strong> Bank transfer (details in your portal)</li>
|
||||
<li><strong>Status:</strong> Your account will be activated once payment is verified</li>
|
||||
</ul>
|
||||
|
||||
<p><em>You can find complete payment instructions in your member portal after verification.</em></p>
|
||||
</div>
|
||||
|
||||
<h3>🌟 What's Next?</h3>
|
||||
<ol>
|
||||
<li><strong>Verify your email</strong> using the button above</li>
|
||||
<li><strong>Log in to your portal</strong> at <a href="https://portal.monacousa.org" class="link">portal.monacousa.org</a></li>
|
||||
<li><strong>Complete your payment</strong> to activate your membership</li>
|
||||
<li><strong>Enjoy member benefits</strong> and connect with our community</li>
|
||||
</ol>
|
||||
|
||||
<p>If you have any questions, please don't hesitate to contact us. We're here to help!</p>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p><strong>MonacoUSA Association</strong><br>
|
||||
Connecting Monaco and the United States</p>
|
||||
|
||||
<p>
|
||||
<a href="https://portal.monacousa.org" class="link">Portal</a> |
|
||||
<a href="mailto:info@monacousa.org" class="link">Contact Us</a> |
|
||||
<a href="https://monacousa.org" class="link">Website</a>
|
||||
</p>
|
||||
|
||||
<p style="margin-top: 20px; font-size: 12px; color: #999;">
|
||||
This email was sent to {{email}} regarding your MonacoUSA membership registration.<br>
|
||||
If you did not register for this account, please ignore this email.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user