Skip to content
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

Added custom SMTP email server testing on the dashboard #376

Merged
merged 15 commits into from
Dec 20, 2024
Merged

Conversation

fomalhautb
Copy link
Contributor

@fomalhautb fomalhautb commented Dec 19, 2024

image image image

Important

Add custom SMTP email server testing feature with backend error handling and frontend UI components.

  • Backend:
    • Add send-test-email route in route.tsx for handling test email requests.
    • Implement sendEmailWithKnownErrorTypes() in emails.tsx for error-handled email sending.
    • Modify isSecureEmailPort() in emails.tsx to check for secure ports.
  • Dashboard:
    • Add TestSendingDialog and EditEmailServerDialog in page-client.tsx for email server testing and configuration.
    • Update FormDialog in form-dialog.tsx to handle form changes and prevent-close behavior.
  • Models and Interfaces:
    • Update emailConfigSchema in projects.ts to export schema.
    • Add sendTestEmail() method to StackAdminInterface in adminInterface.ts and stack-app.ts.

This description was created by Ellipsis for b6e7e09. It will automatically update as commits are pushed.

Copy link

vercel bot commented Dec 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stack-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 5:51pm
stack-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 5:51pm
stack-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 5:51pm

apps/backend/src/lib/emails.tsx Outdated Show resolved Hide resolved
apps/backend/src/lib/emails.tsx Show resolved Hide resolved
apps/backend/src/lib/emails.tsx Outdated Show resolved Hide resolved
@@ -53,6 +56,7 @@
"quetzallabs",
"rehype",
"reqs",
"retryable",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a word (the correct spelling is retriable, but canRetry is probably better anyways; see below)

Suggested change
"retryable",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Sure I will change it to canRetry

apps/backend/src/lib/emails.tsx Outdated Show resolved Hide resolved
Comment on lines +49 to 52
export function isSecureEmailPort(port: number | string) {
let parsedPort = parseInt(port.toString());
const secure = parsedPort === 465;
return { secure };
return parsedPort === 465;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can't determine whether an SMTP server uses TLS or not just by the port (eg. it may be on a different port such as 587, 2525, 25025, etc). Also, 465 is not recommended anyways: https://www.mailgun.com/blog/email/which-smtp-port-understanding-ports-25-465-587/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a setting in the DB for TLS?

apps/backend/src/lib/emails.tsx Outdated Show resolved Hide resolved
packages/stack/src/lib/stack-app.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants