Skip to content

Commit

Permalink
async email sending + more improvements to content
Browse files Browse the repository at this point in the history
  • Loading branch information
DonKoko committed Aug 2, 2024
1 parent c733c5d commit 90556f0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/routes/_layout+/account-details.general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,22 @@ export async function action({ context, request }: ActionFunctionArgs) {
reason = payload?.reason;
}

await sendEmail({
void sendEmail({
to: ADMIN_EMAIL || "[email protected]",
subject: "Delete account request",
text: `User with id ${userId} and email ${payload.email} has requested to delete their account. \n\n Reason: ${reason}`,
text: `User with id ${userId} and email ${payload.email} has requested to delete their account. \n\n Reason: ${reason}\n\n`,
});

void sendEmail({
to: payload.email,
subject: "Delete account request received",
text: `We have received your request to delete your account. It will be processed within 72 hours.\n\n Kind regards,\nthe Shelf team \n\n`,
});

sendNotification({
title: "Account deletion request",
message:
"Your request has been sent to the admin and will be processed within 24 hours.",
"Your request has been sent to the admin and will be processed within 24 hours. You will receive an email confirmation.",
icon: { name: "success", variant: "success" },
senderId: authSession.userId,
});
Expand Down

0 comments on commit 90556f0

Please sign in to comment.