Setup
Install Resend alongside your existing pdfn setup:.env.local
API route
Generate a PDF and send it as an attachment:- App Router
- Pages Router
app/api/send-invoice/route.tsx
Invoice— pdfn template for the PDF attachmentInvoiceEmail— email template for the email body
html or text instead of react for the email body if you don’t need a React component.
Multiple attachments
Generate and attach multiple PDFs:Resend has a 40MB limit per email. For large PDFs, send download links instead.
Next steps
Generate & Render
Client setup, generate() and render() parameters
Components
Document, Page, and layout components