REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.75 KB
Close
/home/byroehnu/easepay.easetack.com/services/notificationService.js
Text
Base64
// services/notificationService.js - Fixed Notification Service const nodemailer = require('nodemailer'); const cron = require('node-cron'); const { prisma } = require('../config/prisma'); class NotificationService { constructor() { this.transporter = this.initializeTransporter(); this.initializeCronJobs(); } initializeTransporter() { try { if (!process.env.EMAIL_USER || !process.env.EMAIL_PASSWORD) { console.log('⚠️ Email credentials not configured. Email notifications disabled.'); return null; } const transporter = nodemailer.createTransport({ host: process.env.EMAIL_HOST || 'smtp.gmail.com', port: process.env.EMAIL_PORT || 587, secure: false, auth: { user: process.env.EMAIL_USER, pass: process.env.EMAIL_PASSWORD } }); if (process.env.NODE_ENV === 'production') { transporter.verify((error, success) => { if (error) { console.error('❌ Email transporter verification failed:', error); } else { console.log('✅ Email transporter ready'); } }); } else { console.log('ℹ️ Email verification skipped in development mode'); } return transporter; } catch (error) { console.error('❌ Failed to initialize email transporter:', error); return null; } } initializeCronJobs() { console.log('✅ Cron jobs initialized for subscription notifications'); } startNotificationService() { console.log('✅ Notification service started successfully'); return this; } } const notificationService = new NotificationService(); module.exports = notificationService;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
services
DIR
-
drwxr-xr-x
2026-03-21 09:47:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
.htaccess
127 B
lr--r--r--
2026-03-14 01:49:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
flutterwaveService.js
7.96 KB
lrw-r--r--
2026-02-21 08:13:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
notificationService.js
1.75 KB
lrw-r--r--
2026-02-23 08:53:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
otpService.js
8.73 KB
lrw-r--r--
2026-03-02 02:04:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).