Skip to content

Emails

GiftWrapt optionally sends a handful of transactional emails: password resets, new-comment notifications, day-of birthday reminders, post-birthday gift summaries, post-Christmas summaries, and configurable pre-event reminders. All outbound mail goes through Resend.

Three environment variables, all optional but all needed together to actually send mail:

Terminal window
RESEND_API_KEY=re_...
RESEND_FROM_EMAIL=giftwrapt@yourdomain.example
RESEND_FROM_NAME=GiftWrapt # optional, defaults to the from-email
RESEND_BCC_ADDRESS=ops@yourdomain # optional, BCC's every send for audit

Once these are set and the server restarts, the admin Settings page surfaces the email-related toggles, and the Admin → Tools page exposes a “Send test email” button you can use to verify delivery end-to-end.

Each category has its own admin toggle, all independent. Disabling a toggle stops the email; it never stops the underlying side-effect (the reveal flow still runs, claims still get archived, etc.).

  • Password reset - sent when a user clicks “forgot password.” Always on when email is configured; not gated by a separate toggle.
  • enableCommentEmails - sent when someone leaves a comment on an item, to the item’s other participants.

Two emails support the orphaned-claim flow. Both fire whenever email is configured - there’s no admin toggle. Spoiler protection and claim integrity are non-negotiable, same rationale as the auto-archive happening regardless of email toggles:

  • Initial alert - sent immediately when the recipient deletes an item the giftgiver had already claimed. Goes to the primary giftgiver and their partner; co-gifters intentionally silent. One email per orphaned item per audience member.
  • Day-before cleanup reminder - sent the day before the auto-cleanup cron hard-deletes an unanswered orphan. One-shot per claim, idempotent via giftedItems.orphanReminderSentAt.
  • enableBirthdayEmails - gates both the day-of birthday email and the post-birthday gifter summary (the recap of who got what).
  • enableChristmasEmails - post-Christmas owner summary, fired by the auto-archive cron after Dec 25.
  • enableGenericHolidayEmails - same as above, but for admin-configured custom holidays.

These broadcast to every user, including users without a list - the explicit intent is to nudge people to make one. Each has a master toggle and a lead-days knob:

  • Birthday reminders (enableBirthdayReminderEmails, birthdayReminderLeadDays) - per user, fires N days before their birthday.
  • Christmas reminders (enableChristmasReminderEmails, christmasReminderLeadDays) - global, fires N days before Dec 25.
  • Holiday reminders (enableHolidayReminderEmails, holidayReminderLeadDays) - per admin-configured holiday.

Reminder emails are also gated by the corresponding list-type master toggle, so disabling the Christmas list type silences its reminder too.

Four independent families with their own master toggles and lead-days settings:

  • Mother’s Day - sent to users who have tagged at least one other user as a mother they shop for.
  • Father’s Day - same, for fathers.
  • Valentine’s Day - sent to partnered users globally on Feb 14.
  • Anniversary - sent to both partners using the optional anniversary date on their profile.

Mother’s Day and Father’s Day use the country configured under relationshipRemindersCountry (default US). The other two are global.

For deliverability, the from-address domain needs verified SPF, DKIM, and DMARC records on the Resend side. Resend’s docs walk through it; once your domain is verified, just paste the from-address into RESEND_FROM_EMAIL and you’re done.

If you only want to test, Resend lets you use their sandbox domain - but mail can only be sent to the address that owns the Resend account.