chore: Refactoring event processors and service architecture (#2495)

This commit is contained in:
Tom Moor
2021-08-27 21:42:13 -07:00
committed by GitHub
parent 86f008293a
commit 28aef82af9
61 changed files with 1610 additions and 1498 deletions

View File

@ -6,7 +6,7 @@ import {
EmailAuthenticationRequiredError,
AuthenticationProviderDisabledError,
} from "../errors";
import { sendEmail } from "../mailer";
import mailer from "../mailer";
import { Collection, Team, User } from "../models";
import teamCreator from "./teamCreator";
import userCreator from "./userCreator";
@ -87,7 +87,10 @@ export default async function accountProvisioner({
const { isNewUser, user } = result;
if (isNewUser) {
sendEmail("welcome", user.email, { teamUrl: team.url });
await mailer.sendTemplate("welcome", {
to: user.email,
teamUrl: team.url,
});
}
if (isNewUser || isNewTeam) {