Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Email Service #21

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/typescript/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class User extends Model {
@Column({ type: DataType.STRING })
auth_id!: string;

@Column({ type: DataType.INTEGER })
@Column({ type: DataType.INTEGER, primaryKey: true })
id!: number;

@Column({ type: DataType.ENUM("User", "Admin") })
Expand Down
2 changes: 2 additions & 0 deletions backend/typescript/nodemailer.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import dotenv from "dotenv";
import { NodemailerConfig } from "./types";

dotenv.config();
const config: NodemailerConfig = {
service: "gmail",
auth: {
Expand Down
4 changes: 2 additions & 2 deletions backend/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "server.ts",
"scripts": {
"test": "jest --runInBand --forceExit --detectOpenHandles",
"test": "jest --runInBand --forceExit",
"dev": "nodemon -L",
"lint": "eslint . --ext .ts,.js",
"fix": "eslint . --ext .ts,.js --fix",
Expand All @@ -24,7 +24,7 @@
"apollo-server-express": "^2.22.2",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"dotenv": "^16.0.3",
"express": "^4.17.1",
"firebase-admin": "^9.5.0",
"graphql": "^15.5.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import EmailService from "../emailService";
import IEmailService from "../../interfaces/emailService";
import nodemailerConfig from "../../../nodemailer.config";

const emailService: IEmailService = new EmailService(nodemailerConfig);

describe("sendEmail", () => {
it("sendEmail", async () => {
await emailService.sendEmail(
"[email protected]",
"Test subject",
"Test body",
);
});
});
7 changes: 6 additions & 1 deletion backend/typescript/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2655,11 +2655,16 @@ dot-prop@^5.2.0:
dependencies:
is-obj "^2.0.0"

dotenv@*, dotenv@^8.2.0:
dotenv@*:
version "8.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==

dotenv@^16.0.3:
version "16.0.3"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07"
integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==

dottie@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/dottie/-/dottie-2.0.2.tgz#cc91c0726ce3a054ebf11c55fbc92a7f266dd154"
Expand Down