forked from NicholasZ4008/ByteTool-Invoice-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrollers.js
More file actions
54 lines (46 loc) · 1.01 KB
/
controllers.js
File metadata and controls
54 lines (46 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const axios = require("axios");
const { generateConfig } = require("./utils");
const nodemailer = require("nodemailer");
const CONSTANTS = require("./constants");
const { google } = require("googleapis");
require("dotenv").config();
const oAuth2Client = new google.auth.OAuth2(
process.env.CLIENT_ID,
process.env.CLIENT_SECRET,
process.env.REDIRECT_URL
);
oAuth2Client.setCredentials({ refresh_token: process.env.REFRESH_TOKEN });
async function sendMail(req, res) {
try {
} catch (error) {
console.log(error);
res.send(error);
}
}
async function getUser(req, res) {
try {
} catch (error) {
console.log(error);
res.send(error);
}
}
async function getDrafts(req, res) {
try {
} catch (error) {
console.log(error);
return error;
}
}
async function readMail(req, res) {
try {
} catch (error) {
res.send(error);
}
}
module.exports = {
//getUser,
sendMail,
//getDrafts,
//searchMail,
//readMail,
};