-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
792 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
{ | ||
"singleQuote": false, | ||
"trailingComma": "all", | ||
"useTabs": false, | ||
"tabWidth": 4, | ||
"printWidth": 120, | ||
"importOrderSeparation": true, | ||
"importOrder": ["<THIRD_PARTY_MODULES>", "^[./]"] | ||
} | ||
"singleQuote": false, | ||
"trailingComma": "all", | ||
"useTabs": false, | ||
"tabWidth": 4, | ||
"printWidth": 100, | ||
"importOrderSeparation": true, | ||
"importOrder": [ | ||
"<THIRD_PARTY_MODULES>", | ||
"^[./]" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import Mail from "nodemailer/lib/mailer"; | ||
|
||
import { EmailString } from "../util/types"; | ||
import Mailer from "./mailer"; | ||
|
||
|
@@ -7,7 +9,9 @@ import Mailer from "./mailer"; | |
export const getDefaultMailer = () => | ||
new Mailer( | ||
process.env["DOCSOC_SMTP_SERVER"] ?? "smtp-mail.outlook.com", | ||
587, | ||
process.env["DOCSOC_SMTP_PORT"] && isFinite(parseInt(process.env["DOCSOC_SMTP_PORT"])) | ||
? parseInt(process.env["DOCSOC_SMTP_PORT"]) | ||
: 587, | ||
process.env["DOCSOC_SMTP_USERNAME"] ?? "[email protected]", | ||
process.env["DOCSOC_SMTP_PASSWORD"] ?? "password", | ||
); | ||
|
@@ -17,7 +21,13 @@ export const getDefaultMailer = () => | |
* | ||
* Pass it an instance of a Mailer from {@link getDefaultMailer} to use the default mailer. | ||
*/ | ||
export const defaultMailer = (to: EmailString[], subject: string, html: string, mailer: Mailer): Promise<void> => | ||
export const defaultMailer = ( | ||
to: EmailString[], | ||
subject: string, | ||
html: string, | ||
mailer: Mailer, | ||
attachments: Mail.Options["attachments"] = [], | ||
): Promise<void> => | ||
mailer.sendMail( | ||
Mailer.makeFromLineFromEmail( | ||
process.env["DOCSOC_SENDER_NAME"] ?? "DoCSoc", | ||
|
@@ -28,4 +38,5 @@ export const defaultMailer = (to: EmailString[], subject: string, html: string, | |
to, | ||
subject, | ||
html, | ||
attachments, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.