start on repond to message (basic input and builder for dm)
This commit is contained in:
@@ -3,9 +3,11 @@ import nodemailer, { Transporter } from "nodemailer";
|
||||
|
||||
export class SmtpInstance {
|
||||
transporter: Transporter;
|
||||
user: string;
|
||||
|
||||
constructor(account: {user: string, password: string}) {
|
||||
constructor(account: { user: string; password: string }) {
|
||||
// todo store other data
|
||||
this.user = account.user;
|
||||
this.transporter = nodemailer.createTransport({
|
||||
host: "smtp.gmail.com",
|
||||
port: 465,
|
||||
@@ -17,20 +19,22 @@ export class SmtpInstance {
|
||||
});
|
||||
}
|
||||
|
||||
sendMail() {
|
||||
const msg = {
|
||||
from: "",
|
||||
to: "",
|
||||
subject: "Hello ✔",
|
||||
text: "Hello world?",
|
||||
html: "<b>Hello world?</b>",
|
||||
};
|
||||
this.transporter.sendMail(msg, (err, message) => {
|
||||
if (err) {
|
||||
logger.err(err);
|
||||
throw err;
|
||||
}
|
||||
logger.log(message);
|
||||
});
|
||||
sendMail(message: any) {
|
||||
console.log(this.user)
|
||||
console.log(message)
|
||||
// const msg = {
|
||||
// from: "",
|
||||
// to: "",
|
||||
// subject: "Hello ✔",
|
||||
// text: "Hello world?",
|
||||
// html: "<b>Hello world?</b>",
|
||||
// };
|
||||
// this.transporter.sendMail(msg, (err, message) => {
|
||||
// if (err) {
|
||||
// logger.err(err);
|
||||
// throw err;
|
||||
// }
|
||||
// logger.log(message);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user