Skip to content

Commit

Permalink
export sendMail
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Nov 27, 2024
1 parent 4a7cbc2 commit 1ee4870
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions lib/Auth/sendEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const sendEmail = (smptConfig: SMTPConfig, email: Email) => {
return send(transporter, email);
}

/**
* Returns a transporter from cache or creates a new one
*/
export const getOrSetTransporter = (smptConfig: SMTPConfig) => {
const configStr = JSON.stringify(smptConfig);
const transporter = transporterCache.get(configStr) ?? getTransporter(smptConfig);
Expand Down
2 changes: 2 additions & 0 deletions lib/Prostgles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
} from "prostgles-types";
import { DBEventsManager } from "./DBEventsManager";
import { PublishParser } from "./PublishParser/PublishParser";
export { sendEmail, getOrSetTransporter } from "./Auth/sendEmail";

export type DB = pgPromise.IDatabase<{}, pg.IClient>;
export type DBorTx = DB | pgPromise.ITask<{}>
Expand Down Expand Up @@ -61,6 +62,7 @@ const DEFAULT_KEYWORDS = {

import { randomUUID } from "crypto";
import * as fs from 'fs';
import { sendEmail } from "./Auth/sendEmail";

export class Prostgles {
/**
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prostgles-server",
"version": "4.2.165",
"version": "4.2.166",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ee4870

Please sign in to comment.