mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 09:12:02 +10:00
feat: add trpc route to send emails
This commit is contained in:
@ -43,9 +43,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<PlausibleProvider>
|
||||
{children}
|
||||
</PlausibleProvider>
|
||||
<PlausibleProvider>{children}</PlausibleProvider>
|
||||
<Toaster />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
"next-auth": "^4.22.1",
|
||||
"next-plausible": "^3.7.2",
|
||||
"next-themes": "^0.2.1",
|
||||
"nodemailer": "^6.9.3",
|
||||
"nodemailer-sendgrid": "^1.0.3",
|
||||
"perfect-freehand": "^1.2.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
@ -38,6 +40,8 @@
|
||||
"devDependencies": {
|
||||
"@types/formidable": "^2.0.6",
|
||||
"@types/node": "20.1.0",
|
||||
"@types/nodemailer": "^6.4.8",
|
||||
"@types/nodemailer-sendgrid": "^1.0.0",
|
||||
"@types/react": "18.2.6",
|
||||
"@types/react-dom": "18.2.4"
|
||||
}
|
||||
|
||||
6
apps/web/process-env.d.ts
vendored
6
apps/web/process-env.d.ts
vendored
@ -11,5 +11,11 @@ declare namespace NodeJS {
|
||||
NEXT_PRIVATE_STRIPE_WEBHOOK_SECRET: string;
|
||||
|
||||
NEXT_PUBLIC_SUBSCRIPTIONS_ENABLED: string;
|
||||
|
||||
NEXT_PRIVATE_SENDGRID_API_KEY: string;
|
||||
NEXT_PRIVATE_SMTP_MAIL_HOST: string;
|
||||
NEXT_PRIVATE_SMTP_MAIL_PORT: string;
|
||||
NEXT_PRIVATE_SMTP_MAIL_USER: string;
|
||||
NEXT_PRIVATE_SMTP_MAIL_PASSWORD: string;
|
||||
}
|
||||
}
|
||||
|
||||
24
apps/web/src/app/send/page.tsx
Normal file
24
apps/web/src/app/send/page.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { trpc } from '@documenso/trpc/react';
|
||||
|
||||
export default function Send() {
|
||||
const { mutateAsync: sendMail } = trpc.document.sendEmail.useMutation();
|
||||
|
||||
return (
|
||||
<div className="p-20">
|
||||
<button
|
||||
className="rounded-md border-2 border-solid border-black px-4 py-2 text-2xl"
|
||||
onClick={async () => {
|
||||
console.log('clicked');
|
||||
|
||||
await sendMail({ email: 'duncan@documenso.com' });
|
||||
}}
|
||||
>
|
||||
Send
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user