💥💣 ALMOST THERE???? DUNNO PROBABLY - 90% done
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
import {
|
||||
Body,
|
||||
Button,
|
||||
Column,
|
||||
Container,
|
||||
Font,
|
||||
Head,
|
||||
Heading,
|
||||
Hr,
|
||||
Html,
|
||||
Img,
|
||||
Preview,
|
||||
Row,
|
||||
Section,
|
||||
Text,
|
||||
Row,
|
||||
Column,
|
||||
Img,
|
||||
Font,
|
||||
} from "@react-email/components";
|
||||
import { Tailwind } from "@react-email/tailwind";
|
||||
|
||||
interface PnrConfirmationProps {
|
||||
pnr: string;
|
||||
uid: string;
|
||||
origin: string;
|
||||
destination: string;
|
||||
departureDate: string;
|
||||
@@ -29,7 +29,7 @@ interface PnrConfirmationProps {
|
||||
}
|
||||
|
||||
export function PnrConfirmationEmail({
|
||||
pnr,
|
||||
uid,
|
||||
origin,
|
||||
destination,
|
||||
passengerName,
|
||||
@@ -39,7 +39,7 @@ export function PnrConfirmationEmail({
|
||||
logoPath,
|
||||
companyName,
|
||||
}: PnrConfirmationProps) {
|
||||
const previewText = `Flight Confirmation: ${origin} to ${destination} - PNR: ${pnr}`;
|
||||
const previewText = `Flight Confirmation: ${origin} to ${destination} - PNR: ${uid}`;
|
||||
|
||||
// Format dates for better display
|
||||
const formattedDepartureDate = new Date(departureDate).toLocaleDateString(
|
||||
@@ -157,7 +157,7 @@ export function PnrConfirmationEmail({
|
||||
Booking Reference (PNR):
|
||||
</Text>
|
||||
<Text className="text-2xl font-semibold text-primary mb-0">
|
||||
{pnr}
|
||||
{uid}
|
||||
</Text>
|
||||
</Section>
|
||||
|
||||
@@ -224,7 +224,7 @@ export function PnrConfirmationEmail({
|
||||
<Section className="text-center mt-8 mb-6">
|
||||
<Button
|
||||
className="bg-primary text-white font-bold px-6 py-3 rounded-md"
|
||||
href={`${baseUrl}/track?pnr=${pnr}`}
|
||||
href={`${baseUrl}/track?uid=${uid}`}
|
||||
>
|
||||
View Booking Online
|
||||
</Button>
|
||||
@@ -259,7 +259,7 @@ export function PnrConfirmationEmail({
|
||||
}
|
||||
|
||||
PnrConfirmationEmail.PreviewProps = {
|
||||
pnr: "ABC123",
|
||||
uid: "ABC123",
|
||||
origin: "SFO",
|
||||
destination: "JFK",
|
||||
departureDate: "2023-12-15",
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Resend } from "resend";
|
||||
import { type EmailServiceProvider, type EmailPayload } from "./data";
|
||||
import { ERROR_CODES, type Result } from "@pkg/result";
|
||||
import { getError } from "@pkg/logger";
|
||||
import PnrConfirmationEmail from "../emails/pnr-confirmation";
|
||||
import { ERROR_CODES, type Result } from "@pkg/result";
|
||||
import { createElement } from "react";
|
||||
import { Resend } from "resend";
|
||||
import PnrConfirmationEmail from "../emails/uid-confirmation";
|
||||
import { type EmailPayload, type EmailServiceProvider } from "./data";
|
||||
|
||||
export class ResendEmailSvcProvider implements EmailServiceProvider {
|
||||
private client: Resend | null = null;
|
||||
@@ -82,7 +82,7 @@ export class ResendEmailSvcProvider implements EmailServiceProvider {
|
||||
let body = undefined as any;
|
||||
|
||||
switch (payload.template) {
|
||||
case "pnr-confirmation":
|
||||
case "uid-confirmation":
|
||||
body = createElement(PnrConfirmationEmail, payload.templateData);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user