feat: add Interruzione email template and integrate into mailer service
This commit is contained in:
parent
bb8c796fa8
commit
04f0c5e790
4 changed files with 47 additions and 12 deletions
|
|
@ -13,4 +13,3 @@ AFTER MVP:
|
||||||
- Report andamento props: Generate a Report with selected user review, analytics and other data for the apartment owner
|
- Report andamento props: Generate a Report with selected user review, analytics and other data for the apartment owner
|
||||||
- Infoalloggi.AI: Pagina area riservata "Infoalloggi.it AI" o "la mia ricerca Infoalloggi" robe cosí in cui il sistema fa una ricerca personalizzata, elemento marketizzabile
|
- Infoalloggi.AI: Pagina area riservata "Infoalloggi.it AI" o "la mia ricerca Infoalloggi" robe cosí in cui il sistema fa una ricerca personalizzata, elemento marketizzabile
|
||||||
- Document scan: Document scan for upload
|
- Document scan: Document scan for upload
|
||||||
- indirizzo autocomplete nomatim:
|
|
||||||
|
|
|
||||||
33
apps/infoalloggi/emails/interruzione.tsx
Normal file
33
apps/infoalloggi/emails/interruzione.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
import { Heading, Row, Section, Text } from "@react-email/components";
|
||||||
|
import Base from "./base";
|
||||||
|
export type Interruzione_NewMail = {
|
||||||
|
mailType: "interruzione";
|
||||||
|
};
|
||||||
|
|
||||||
|
const Interruzione = () => {
|
||||||
|
return (
|
||||||
|
<Base noreply preview="Interruzione servizio InfoAlloggi">
|
||||||
|
<>
|
||||||
|
<Heading className="text-center text-2xl leading-8">
|
||||||
|
Interruzione servizio InfoAlloggi
|
||||||
|
</Heading>
|
||||||
|
<Section className="px-5 text-left text-base md:px-12">
|
||||||
|
<Row>
|
||||||
|
<Text>Gentile Cliente,</Text>
|
||||||
|
<Text>
|
||||||
|
Il servizio di ricerca è stato interrotto su tua richiesta,
|
||||||
|
pertanto non c'è nessun saldo da effettuare.
|
||||||
|
</Text>
|
||||||
|
<Text>
|
||||||
|
Restiamo a disposizione per qualsiasi necessità, per una nuova
|
||||||
|
ricerca o per altre informazioni.
|
||||||
|
</Text>
|
||||||
|
<Text>Cordiali saluti</Text>
|
||||||
|
</Row>
|
||||||
|
</Section>
|
||||||
|
</>
|
||||||
|
</Base>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Interruzione;
|
||||||
|
|
@ -927,17 +927,13 @@ export const interruzioneServizio = async (servizioId: ServizioServizioId) => {
|
||||||
|
|
||||||
// NOTIFICHE EMAIL INTERRUZIONE SERVIZIO
|
// NOTIFICHE EMAIL INTERRUZIONE SERVIZIO
|
||||||
const utente = await getUser({ db, userId: servizio.user_id });
|
const utente = await getUser({ db, userId: servizio.user_id });
|
||||||
|
|
||||||
await NewMail({
|
await NewMail({
|
||||||
template: {
|
template: {
|
||||||
mailType: "generic",
|
mailType: "interruzione",
|
||||||
props: {
|
|
||||||
noreply: true,
|
|
||||||
testo: `Abbiamo ricevuto la tua richiesta di interruzione del servizio di ricerca affitto per la tipologia ${servizio.tipologia}. Il servizio è stato interrotto con successo.`,
|
|
||||||
title: `Servizio Ricerca Affitto ${servizio.tipologia} interrotto`,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mail: {
|
mail: {
|
||||||
subject: `Servizio Ricerca Affitto ${servizio.tipologia} interrotto`,
|
subject: `Servizio Ricerca Affitto ${servizio.tipologia} interrotto.`,
|
||||||
to: utente.email,
|
to: utente.email,
|
||||||
},
|
},
|
||||||
userId: utente.id,
|
userId: utente.id,
|
||||||
|
|
@ -948,7 +944,7 @@ export const interruzioneServizio = async (servizioId: ServizioServizioId) => {
|
||||||
mailType: "generic",
|
mailType: "generic",
|
||||||
props: {
|
props: {
|
||||||
link: {
|
link: {
|
||||||
href: `${env.BASE_URL}/area-riservata/admin/user-view/ricerca/${servizio.user_id}#${servizioId}`,
|
href: `${env.BASE_URL}/area-riservata/admin/user-view/servizio/${servizio.user_id}/${servizioId}`,
|
||||||
label: "Vai al servizio",
|
label: "Vai al servizio",
|
||||||
},
|
},
|
||||||
noreply: true,
|
noreply: true,
|
||||||
|
|
@ -1072,7 +1068,7 @@ export const userSendConfermaIntent = async ({
|
||||||
mailType: "generic",
|
mailType: "generic",
|
||||||
props: {
|
props: {
|
||||||
link: {
|
link: {
|
||||||
href: `${env.BASE_URL}/area-riservata/admin/user-view/ricerca/${servizio.user_id}#${servizioId}-${annuncioId}`,
|
href: `${env.BASE_URL}/area-riservata/admin/user-view/ricerca/${servizio.user_id}`,
|
||||||
label: "Visualizza Annuncio",
|
label: "Visualizza Annuncio",
|
||||||
},
|
},
|
||||||
noreply: true,
|
noreply: true,
|
||||||
|
|
@ -1210,7 +1206,7 @@ export const userAccettaConferma = async ({
|
||||||
mailType: "generic",
|
mailType: "generic",
|
||||||
props: {
|
props: {
|
||||||
link: {
|
link: {
|
||||||
href: `${env.BASE_URL}/area-riservata/admin/user-view/ricerca/${servizio.user_id}#${servizioId}-${annuncioId}`,
|
href: `${env.BASE_URL}/area-riservata/admin/user-view/servizio/${servizio.user_id}/${servizioId}`,
|
||||||
label: "Vai al servizio",
|
label: "Vai al servizio",
|
||||||
},
|
},
|
||||||
noreply: true,
|
noreply: true,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ import EmailContattoInteressato, {
|
||||||
} from "emails/email-interessato";
|
} from "emails/email-interessato";
|
||||||
import type { Generic_NewMail } from "emails/gereric-email";
|
import type { Generic_NewMail } from "emails/gereric-email";
|
||||||
import Generic from "emails/gereric-email";
|
import Generic from "emails/gereric-email";
|
||||||
|
import type { Interruzione_NewMail } from "emails/interruzione";
|
||||||
|
import Interruzione from "emails/interruzione";
|
||||||
import type { Invito_NewMail } from "emails/invito";
|
import type { Invito_NewMail } from "emails/invito";
|
||||||
import Invito from "emails/invito";
|
import Invito from "emails/invito";
|
||||||
import type { PagamentoConferma_NewMail } from "emails/pagamento-conferma";
|
import type { PagamentoConferma_NewMail } from "emails/pagamento-conferma";
|
||||||
|
|
@ -94,7 +96,8 @@ export type MailsTemplates =
|
||||||
| SchedaContatto_NewMail
|
| SchedaContatto_NewMail
|
||||||
| Invito_NewMail
|
| Invito_NewMail
|
||||||
| ServizioAttivato_NewMail
|
| ServizioAttivato_NewMail
|
||||||
| AvvisoInterruzione_NewMail;
|
| AvvisoInterruzione_NewMail
|
||||||
|
| Interruzione_NewMail;
|
||||||
|
|
||||||
export const genMail = async ({ ...mail }: MailsTemplates) => {
|
export const genMail = async ({ ...mail }: MailsTemplates) => {
|
||||||
let mailComponent: JSX.Element | null = null;
|
let mailComponent: JSX.Element | null = null;
|
||||||
|
|
@ -186,6 +189,10 @@ export const genMail = async ({ ...mail }: MailsTemplates) => {
|
||||||
mailComponent = AvvisoInterruzione();
|
mailComponent = AvvisoInterruzione();
|
||||||
title = "Avviso Interruzione";
|
title = "Avviso Interruzione";
|
||||||
break;
|
break;
|
||||||
|
case "interruzione":
|
||||||
|
mailComponent = Interruzione();
|
||||||
|
title = "Interruzione servizio";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
console.error(`Tipo di email non valido: ${mail satisfies never}`);
|
console.error(`Tipo di email non valido: ${mail satisfies never}`);
|
||||||
return { html: "", title: "Email non valido/modello obsoleto" };
|
return { html: "", title: "Email non valido/modello obsoleto" };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue