Skip to content

Commit

Permalink
updated some email subjects, removed void from sendEmail calls in 2 p…
Browse files Browse the repository at this point in the history
…laces where it was still left
  • Loading branch information
DonKoko committed Jan 24, 2025
1 parent af4919d commit 72eaf05
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/components/user/request-delete-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { TrashIcon } from "../icons/library";

const Schema = z.object({
email: z.string().email(),
reason: z.string().min(10, "Reason is a required field"),
reason: z.string().min(3, "Reason is a required field"),
});

export const RequestDeleteUser = () => {
Expand Down
2 changes: 1 addition & 1 deletion app/modules/booking/email-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export function sendCheckinReminder(
) {
sendEmail({
to: booking.custodianUser!.email,
subject: `Checkin reminder (${booking.name}) - shelf.nu`,
subject: `🔔 Checkin reminder (${booking.name}) - shelf.nu`,
text: checkinReminderEmailContent({
hints,
bookingName: booking.name,
Expand Down
3 changes: 1 addition & 2 deletions app/modules/booking/service.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export async function upsertBooking(
}

if (data.status === BookingStatus.COMPLETE) {
subject = `Booking completed (${res.name}) - shelf.nu`;
subject = `🎉 Booking completed (${res.name}) - shelf.nu`;
text = completedBookingEmailContent({
bookingName: res.name,
assetsCount: res._count.assets,
Expand Down Expand Up @@ -858,7 +858,6 @@ export async function deleteBooking(
});
}

// FIXME: if sendEmail fails updateBookinAssetStates will not be called
/** Because assets in an active booking have a special status, we need to update them if we delete a booking */
if (activeBooking) {
await updateBookingAssetStates(activeBooking, AssetStatus.AVAILABLE);
Expand Down
2 changes: 1 addition & 1 deletion app/modules/booking/worker.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const overdueReminder = async ({ data }: PgBoss.Job<SchedulerData>) => {
if (email) {
sendEmail({
to: email,
subject: `Overdue booking (${booking.name}) - shelf.nu`,
subject: `⚠️ Overdue booking (${booking.name}) - shelf.nu`,
text: overdueBookingEmailContent({
bookingName: booking.name,
assetsCount: booking._count.assets,
Expand Down
4 changes: 2 additions & 2 deletions app/routes/_layout+/account-details.general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ export async function action({ context, request }: ActionFunctionArgs) {
reason = payload?.reason;
}

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

void sendEmail({
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`,
Expand Down

0 comments on commit 72eaf05

Please sign in to comment.