Christmas gifts and timed gift e-mails
- Gifts bought 15 Nov - 6 Jan get a Christmas card ("Boldog karácsonyt és
csillagos 2027-et!", snowflakes) and a Christmas e-mail subject.
- The buyer can time the gift e-mail (e.g. Christmas morning); "Küldés most"
replaces a waiting one, a refund takes it back.
- Admin: timed e-mails by hour (waiting / sent / failed), e-mail state per gift.
- /karacsony landing page; seasonal hints on /csomagok and /ajandek.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -12,6 +12,15 @@ const day = (iso: string) =>
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
});
|
||||
/** "december 24., 8:00" */
|
||||
const when = (iso: string) =>
|
||||
new Date(iso).toLocaleString("hu-HU", {
|
||||
timeZone: "Europe/Budapest",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
});
|
||||
const time = (iso: string) =>
|
||||
new Date(iso).toLocaleTimeString("hu-HU", {
|
||||
timeZone: "Europe/Budapest",
|
||||
@@ -127,7 +136,19 @@ function GiftItem({
|
||||
</div>
|
||||
|
||||
<p className="gift-to">
|
||||
{gift.recipient_email ? (
|
||||
{gift.recipient_email &&
|
||||
gift.email_state === "scheduled" &&
|
||||
gift.send_at ? (
|
||||
<>
|
||||
Időzítve: <strong>{when(gift.send_at)}</strong>, ide:{" "}
|
||||
<strong>{gift.recipient_email}</strong>
|
||||
</>
|
||||
) : gift.recipient_email && gift.email_state === "failed" ? (
|
||||
<>
|
||||
Nem sikerült elküldeni ide: <strong>{gift.recipient_email}</strong>.
|
||||
Ellenőrizd a címet, és küldd újra.
|
||||
</>
|
||||
) : gift.recipient_email ? (
|
||||
<>
|
||||
E-mailben elküldve ide: <strong>{gift.recipient_email}</strong>
|
||||
{gift.sendings > 1 ? ` (${gift.sendings}×)` : ""}
|
||||
@@ -165,9 +186,11 @@ function GiftItem({
|
||||
className="btn btn-sm"
|
||||
onClick={() => setSending(true)}
|
||||
>
|
||||
{gift.recipient_email
|
||||
? "Újraküldés e-mailben"
|
||||
: "Küldés e-mailben"}
|
||||
{gift.email_state === "scheduled"
|
||||
? "Küldés most"
|
||||
: gift.recipient_email
|
||||
? "Újraküldés e-mailben"
|
||||
: "Küldés e-mailben"}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user