EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
pushEmailToRedis.js
Go to the documentation of this file.
1// Example backend code to push inbound emails to Redis
2const Redis = require('ioredis');
3const redisConfig = require('./config/redis');
4const redis = new Redis(redisConfig);
5
6/**
7 *
8 * @param email
9 */
10function pushEmail(email) {
11 redis.publish('emails:inbound', JSON.stringify(email));
12}
13
14module.exports = { pushEmail };
15
16// Usage: pushEmail({ id, text, ... })