refactor: remove ShareAnnunci email component and its related type from mailer
This commit is contained in:
parent
9d66997001
commit
162c456834
2 changed files with 0 additions and 113 deletions
|
|
@ -1,105 +0,0 @@
|
|||
import {
|
||||
Heading,
|
||||
Img,
|
||||
Link,
|
||||
Row,
|
||||
Section,
|
||||
Text,
|
||||
} from "@react-email/components";
|
||||
import { env } from "~/env";
|
||||
import Base2 from "./base2";
|
||||
export type ShareAnnunci_NewMail = {
|
||||
mailType: "shareAnnunci";
|
||||
props: ShareAnnunciProps;
|
||||
};
|
||||
|
||||
type ShareAnnunciProps = {
|
||||
nome: string;
|
||||
annunci?: {
|
||||
titolo: string | null;
|
||||
immagine: string | null;
|
||||
codice: string;
|
||||
prezzo: number;
|
||||
}[];
|
||||
};
|
||||
//TODO finire
|
||||
|
||||
const ShareAnnunci = ({ nome, annunci }: ShareAnnunciProps) => {
|
||||
nome = "";
|
||||
annunci = [
|
||||
{
|
||||
titolo: "MAROSTICA A 2 KM DAL CENTRO MANSARDA - SUBITO",
|
||||
codice: "4493B",
|
||||
prezzo: 40000,
|
||||
immagine: "5434eb7f088a5b5a",
|
||||
},
|
||||
{
|
||||
titolo: "MAROSTICA A 2 KM DAL CENTRO MANSARDA - SUBITO",
|
||||
codice: "4493B",
|
||||
prezzo: 40000,
|
||||
immagine: "5434eb7f088a5b5a",
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Base2 preview="Procedi ora su Infoalloggi.it">
|
||||
<>
|
||||
<Heading className="text-center text-3xl leading-8">
|
||||
Procedi ora su Infoalloggi.it
|
||||
</Heading>
|
||||
<Section className="px-5 text-left text-base md:px-12">
|
||||
<Row>
|
||||
<Text>
|
||||
Ciao {nome},<br />
|
||||
Accedi ora al servizio di ricerca Infoalloggi, dove potrai andare
|
||||
a contattare direttamente i proprietari degli immobili
|
||||
disponibili.
|
||||
</Text>
|
||||
</Row>
|
||||
|
||||
<Section>
|
||||
<Text className="font-semibold">Annunci selezionati per te:</Text>
|
||||
{annunci?.map((annuncio) => (
|
||||
<>
|
||||
<Section className="mb-7.5" key={annuncio.codice}>
|
||||
<Row className="mb-3">
|
||||
<Img
|
||||
alt={`Annuncio image - ${annuncio.codice}`}
|
||||
className="block w-60 rounded-md object-cover object-center"
|
||||
height="140px"
|
||||
src={`${env.BASE_URL}/storage-api/get/${annuncio.immagine}?media=image`}
|
||||
width="100%"
|
||||
/>
|
||||
</Row>
|
||||
<Row className="block w-full">
|
||||
<div className="mb-1 w-fit rounded-md bg-indigo-600 px-2 font-semibold text-sm text-white">
|
||||
<strong>Codice: {annuncio.codice}</strong>
|
||||
</div>
|
||||
<Heading
|
||||
as="h2"
|
||||
className="mt-0 mb-1.5 font-bold text-[16px] leading-none"
|
||||
>
|
||||
{annuncio.titolo || "N/A"}
|
||||
</Heading>
|
||||
<Text className="m-0 text-[14px] text-gray-500 leading-6">
|
||||
<strong>Prezzo:</strong> €
|
||||
{(annuncio.prezzo / 1e2).toFixed(2)}
|
||||
</Text>
|
||||
<Link
|
||||
className="block font-semibold text-[14px] text-indigo-600 no-underline"
|
||||
href={`${env.BASE_URL}/annuncio/${annuncio.codice}`}
|
||||
>
|
||||
Scheda dell'annuncio →
|
||||
</Link>
|
||||
</Row>
|
||||
</Section>
|
||||
</>
|
||||
))}
|
||||
</Section>
|
||||
</Section>
|
||||
</>
|
||||
</Base2>
|
||||
);
|
||||
};
|
||||
|
||||
export default ShareAnnunci;
|
||||
|
|
@ -31,7 +31,6 @@ import type { ContattiConScheda_NewMail } from "emails/scheda-contatti";
|
|||
import EmailContattiConScheda from "emails/scheda-contatti";
|
||||
import type { ServizioAttivato_NewMail } from "emails/servizio-attivato";
|
||||
import ServizioAttivato from "emails/servizio-attivato";
|
||||
import ShareAnnunci, { type ShareAnnunci_NewMail } from "emails/share-annunci";
|
||||
import VerificaEmail, {
|
||||
type VerificaEmail_NewMail,
|
||||
} from "emails/VerificaEmail";
|
||||
|
|
@ -91,7 +90,6 @@ export type MailsTemplates =
|
|||
| Recesso_NewMail
|
||||
| RegistrazioneAvvenuta_NewMail
|
||||
| VerificaEmail_NewMail
|
||||
| ShareAnnunci_NewMail
|
||||
| Generic_NewMail
|
||||
| SchedaContatto_NewMail
|
||||
| Invito_NewMail
|
||||
|
|
@ -162,12 +160,6 @@ export const genMail = async ({ ...mail }: MailsTemplates) => {
|
|||
title = "Verifica email";
|
||||
break;
|
||||
|
||||
case "shareAnnunci":
|
||||
mailComponent = ShareAnnunci({
|
||||
...mail.props,
|
||||
});
|
||||
title = "Onboarding Servizio";
|
||||
break;
|
||||
case "generic":
|
||||
mailComponent = Generic({
|
||||
...mail.props,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue