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

feat(web): send test email button #10011

Merged
merged 15 commits into from
Jun 7, 2024
Merged

feat(web): send test email button #10011

merged 15 commits into from
Jun 7, 2024

Conversation

alextran1502
Copy link
Contributor

@alextran1502 alextran1502 commented Jun 6, 2024

This PR adds a button to send a test email when setting up STMP configuration, then save the setting if an email is sent succesfully.

image

image

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

Where should we add the endpoint for this? Maybe in the jobs controller?

server/src/repositories/notification.repository.ts Outdated Show resolved Hide resolved
@alextran1502 alextran1502 self-assigned this Jun 6, 2024
@alextran1502 alextran1502 marked this pull request as ready for review June 6, 2024 13:42
server/src/controllers/notification.controller.ts Outdated Show resolved Hide resolved
server/src/emails/test.email.tsx Outdated Show resolved Hide resolved
server/src/services/notification.service.ts Outdated Show resolved Hide resolved
@HttpCode(HttpStatus.NO_CONTENT)
@Authenticated()
testEmailNotification(@Auth() auth: AuthDto) {
return this.service.handleTestEmailSetup({ id: auth.user.id });
Copy link
Contributor

Choose a reason for hiding this comment

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

Feedback from the web notification is pretty bad. It tells you a test email has been sent, even though the smtp config is empty.

Why isn't NotificationRepository.sendEmail called directly? Then any errors can be relayed to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am reworking to invoke those repository method directly

Copy link
Contributor

Choose a reason for hiding this comment

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

That's much better already. However, I still think there's room for improvement. When an smtp error like 530 5.7.0 User not authenticated occurs, it would be beneficial to show this error to troubleshoot the settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be a larger rework on how we send the HTTPException and have it displayed correctly with the openapi runtime we use

@alextran1502 alextran1502 requested a review from jrasm91 June 7, 2024 06:59
@alextran1502 alextran1502 merged commit 9ac2ac2 into main Jun 7, 2024
23 checks passed
@alextran1502 alextran1502 deleted the feat/test-email-button branch June 7, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants