Open
Description
Hello,
When sending transactional emails with Plunk, in certain cases, the function fails with this message:
Invalid 'prisma_1.prisma.email.create()' invocation in
/app/packages/api/dist/controllers/v1/index.js:261:66
258 }),
259 },
260 });
→ 261 const createdEmail = await prisma_1.prisma.email.create(
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "22021", message: "invalid byte sequence for encoding \"UTF8\": 0x00", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })
at Plunk.<anonymous> (/Users/thomasleclech/Code/inscriptor/apps/server/node_modules/@plunk/node/dist/lib/Plunk.js:65:23)
at Generator.next (<anonymous>)
at fulfilled (/Users/thomasleclech/Code/inscriptor/apps/server/node_modules/tslib/tslib.js:166:62)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 74873 - 11/12/2024, 12:25:02 PM ERROR [ExceptionsHandler]
Invalid 'prisma_1.prisma.email.create()' invocation in
/app/packages/api/dist/controllers/v1/index.js:261:66
258 }),
259 },
260 });
→ 261 const createdEmail = await prisma_1.prisma.email.create(
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "22021", message: "invalid byte sequence for encoding \"UTF8\": 0x00", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })
Error:
Invalid 'prisma_1.prisma.email.create()' invocation in
/app/packages/api/dist/controllers/v1/index.js:261:66
258 }),
259 },
260 });
→ 261 const createdEmail = await prisma_1.prisma.email.create(`
The email does not appear to be sent on Plunk dashboard but I receive it anyway.
I'm using this function with React Email:
const emailHtml = await render(
FiscalReceiptEmail({
firstName: element.order?.member?.firstName || undefined,
contactEmail: formattedTenant.settings?.fr_contactEmail,
fiscalReceiptUrl: `${formattedTenant.settings?.fr_pdf_download_url}?id=${element.id}`,
logoUrl: formattedTenant.logo || undefined,
type: element.order.member ? 'individual' : 'organization',
thankMessage: formattedTenant.settings?.fr_thankMessage,
tenant: {
street: formattedTenant?.address?.number
? formattedTenant.address.number + ' ' + formattedTenant.address.street
: formattedTenant?.address?.street
? formattedTenant.address.street
: undefined,
city: formattedTenant?.address?.city,
zipCode: formattedTenant?.address?.postalCode,
name: formattedTenant?.name,
},
}),
);
const email = await plunk.emails.send({
to: emailAddress,
subject: 'Reçu fiscal disponible',
body: emailHtml,
});`
Thank you