-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] feat: automatic emails #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds email functionality to the backend server with React-based email templates and SMTP configuration. The changes support sending welcome emails to new members using Azure Communication Services.
- Implements email sending functionality with nodemailer and React-email
- Adds SMTP configuration with Azure Communication Services integration
- Creates a welcome email template with test endpoint
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/tsconfig.json | Adds JSX support and .tsx file inclusion for React email templates |
| backend/src/websocket/index.ts | Fixes class name casing from WebsocketServer to WebSocketServer |
| backend/src/utils/types.ts | Adds new MaybeArray utility type for flexible array/single value handling |
| backend/src/server.ts | Removes redundant import alias and adds test endpoint for email functionality |
| backend/src/env.ts | Reorganizes environment variables and adds SMTP server configuration |
| backend/src/emails/templates/welcome.tsx | Creates new welcome email template using React-email components |
| backend/src/emails/index.tsx | Implements email sending service with production/test transport logic |
| backend/package.json | Adds React, nodemailer, and react-email dependencies plus email dev script |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| <Text className="text-base my-2"> | ||
| To activate your Office 365 account, using a PC open{" "} | ||
| <Link target="_blank" className="underline text-[#1156AE] cursor-pointer"> |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Link component is missing the required href attribute, which will cause it to not function as a hyperlink. Add an href prop with the Microsoft login URL.
| <Link target="_blank" className="underline text-[#1156AE] cursor-pointer"> | |
| <Link | |
| target="_blank" | |
| href="https://login.microsoftonline.com/" | |
| className="underline text-[#1156AE] cursor-pointer" | |
| > |
|
|
||
| <Text className="text-base my-2"> | ||
| If you encounter any issue or have some questions, please contact me on{" "} | ||
| <Link target="_blank" className="underline text-[#1156AE] cursor-pointer"> |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Link component is missing the required href attribute, which will cause it to not function as a hyperlink. Add an href prop with the appropriate Telegram contact URL.
| <Link target="_blank" className="underline text-[#1156AE] cursor-pointer"> | |
| <Link | |
| target="_blank" | |
| href="https://t.me/lorenzocorallo" | |
| className="underline text-[#1156AE] cursor-pointer" | |
| > |
| html, | ||
| }) | ||
| : await testTransport.sendMail({ | ||
| from: "Test PoliNetwork APS <[email protected]", |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing closing angle bracket in the email address. The string should be \"Test PoliNetwork APS <[email protected]>\" to properly format the email address.
| from: "Test PoliNetwork APS <[email protected]", | |
| from: "Test PoliNetwork APS <[email protected]>", |
| app.post("/test-email", async (c) => { | ||
| if (env.NODE_ENV === "production") return c.status(500) | ||
|
|
||
| await sendEmail({ | ||
| to: "[email protected]", | ||
| subject: "Welcome to PoliNetwork", | ||
| email: WelcomeEmail, | ||
| props: { email: "[email protected]", password: "R@123123123123as", assocNum: 12, firstName: "Lorenzo" }, | ||
| forceProd: true, | ||
| }) | ||
| // await sendEmail({ | ||
| // to: "[email protected]", | ||
| // subject: "Welcome to PoliNetwork", | ||
| // email: WelcomeEmail, | ||
| // props: { email: "example@polinetwork.org", password: "R@123123123123as", assocNum: 12, firstName: "Lorenzo" }, | ||
| // }) | ||
| return c.text("Success!") | ||
| }) |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test endpoint exposes a real email address and should not be included in production code. Consider removing this entire endpoint or at least remove the hardcoded personal email address and use a test email address instead.
| </Link>{" "} | ||
| insert the credentials and follow the onboarding. <br /> | ||
| </Text> | ||
|
|
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number 370px for the responsive breakpoint is repeated multiple times and should be extracted into a constant or documented with a comment explaining its significance.
| {/* The 370px breakpoint is used to switch the grid layout for small screens. | |
| If you need to change the responsive behavior, update all instances of 370px below. */} |
No description provided.