Skip to content

Commit

Permalink
feat: send mail on user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Patek committed Feb 9, 2025
1 parent 6ede95c commit 07eda7c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { revalidateTag } from "next/cache";
import { authFirestore } from "@/utils/authFirestore";
import { CacheTag, getCacheTagSpecific } from "@/utils/cacheTags";
import Seznam from "@/utils/seznam.provider";
import { sendMail } from "@/actions/mail";

const providers: Provider[] = [
Google({
Expand Down Expand Up @@ -37,6 +38,10 @@ export const { auth, handlers, signIn, signOut } = NextAuth({
},
events: {
async createUser(message) {
await sendMail({
subject: "[RS][Info] Nový uživatel",
text: `Byl vytvořen nový uživatel s emailem ${message.user.email}`,
});
revalidateTag(CacheTag.UsersCount);
},
async updateUser(message) {
Expand Down

0 comments on commit 07eda7c

Please sign in to comment.