From 3635320ce86582d1addd629d45076be881724337 Mon Sep 17 00:00:00 2001
From: Miguel Cabrerizo <30386061+doncicuto@users.noreply.github.com>
Date: Thu, 20 Jun 2024 21:51:42 +0200
Subject: [PATCH] feat: send test mail (#7968)
# Which Problems Are Solved
- Zitadel doesn't have a way to test SMTP settings either before
creating a new provider or once the SMTP provider has been created.
- Zitadel SMTP messages can be more informative for usual errors
# How the Problems Are Solved
- A new step is added to the new/update SMTP provider wizard that allows
us to test a configuration. The result is shown in a text area.
- From the table of SMTP providers you can test your settings too.
- The email address to send the email is by default the email address
for the logged in user as suggested.
- Some of the SMTP error messages have been changed to give more
information about the possible situation. For example: could not contact
with the SMTP server, check the port, firewall issues... instead of
could not dial
Here's a video showing this new option in action:
https://github.com/zitadel/zitadel/assets/30386061/50128ba1-c9fa-4481-8eec-e79a3ca69bda
# Additional Changes
Replace this example text with a concise list of additional changes that
this PR introduces, that are not directly solving the initial problem
but are related.
For example:
- The docs explicitly describe that the property XY is mandatory
- Adds missing translations for validations.
# Additional Context
- Closes #4504
---
.../smtp-provider.component.html | 73 +++-
.../smtp-provider/smtp-provider.component.ts | 57 +++-
.../modules/smtp-provider/smtp-provider.scss | 22 ++
.../smtp-table/smtp-table.component.html | 12 +
.../smtp-table/smtp-table.component.ts | 16 +
.../modules/smtp-table/smtp-table.module.ts | 2 +
.../smtp-test-dialog.component.html | 47 +++
.../smtp-test-dialog.component.scss | 51 +++
.../smtp-test-dialog.component.spec.ts | 24 ++
.../smtp-test-dialog.component.ts | 72 ++++
.../smtp-test-dialog.module.ts | 26 ++
console/src/app/services/admin.service.ts | 13 +
console/src/assets/i18n/bg.json | 19 +-
console/src/assets/i18n/cs.json | 9 +-
console/src/assets/i18n/de.json | 10 +-
console/src/assets/i18n/en.json | 15 +-
console/src/assets/i18n/es.json | 9 +-
console/src/assets/i18n/fr.json | 10 +-
console/src/assets/i18n/it.json | 10 +-
console/src/assets/i18n/ja.json | 9 +-
console/src/assets/i18n/mk.json | 9 +-
console/src/assets/i18n/nl.json | 9 +-
console/src/assets/i18n/pl.json | 9 +-
console/src/assets/i18n/pt.json | 9 +-
console/src/assets/i18n/ru.json | 9 +-
console/src/assets/i18n/sv.json | 15 +-
console/src/assets/i18n/zh.json | 10 +-
.../manage/console/default-settings.mdx | 8 +
docs/static/img/guides/console/smtp_table.png | Bin 0 -> 26985 bytes
docs/static/img/guides/console/smtp_test.png | Bin 0 -> 34879 bytes
.../e2e/instance/settings/notifications.cy.ts | 13 +-
internal/api/grpc/admin/smtp.go | 27 ++
internal/command/smtp.go | 83 +++++
internal/command/smtp_test.go | 323 ++++++++++++++++++
.../notification/channels/smtp/channel.go | 71 +++-
internal/static/i18n/bg.yaml | 13 +
internal/static/i18n/cs.yaml | 13 +
internal/static/i18n/de.yaml | 13 +
internal/static/i18n/en.yaml | 13 +
internal/static/i18n/es.yaml | 13 +
internal/static/i18n/fr.yaml | 13 +
internal/static/i18n/it.yaml | 13 +
internal/static/i18n/ja.yaml | 13 +
internal/static/i18n/mk.yaml | 13 +
internal/static/i18n/nl.yaml | 14 +
internal/static/i18n/pl.yaml | 13 +
internal/static/i18n/pt.yaml | 13 +
internal/static/i18n/ru.yaml | 13 +
internal/static/i18n/sv.yaml | 14 +-
internal/static/i18n/zh.yaml | 13 +
proto/zitadel/admin.proto | 110 ++++++
51 files changed, 1362 insertions(+), 46 deletions(-)
create mode 100644 console/src/app/modules/smtp-test-dialog/smtp-test-dialog.component.html
create mode 100644 console/src/app/modules/smtp-test-dialog/smtp-test-dialog.component.scss
create mode 100644 console/src/app/modules/smtp-test-dialog/smtp-test-dialog.component.spec.ts
create mode 100644 console/src/app/modules/smtp-test-dialog/smtp-test-dialog.component.ts
create mode 100644 console/src/app/modules/smtp-test-dialog/smtp-test-dialog.module.ts
create mode 100644 docs/static/img/guides/console/smtp_table.png
create mode 100644 docs/static/img/guides/console/smtp_test.png
diff --git a/console/src/app/modules/smtp-provider/smtp-provider.component.html b/console/src/app/modules/smtp-provider/smtp-provider.component.html
index 80d90df49..78ce22c21 100644
--- a/console/src/app/modules/smtp-provider/smtp-provider.component.html
+++ b/console/src/app/modules/smtp-provider/smtp-provider.component.html
@@ -2,7 +2,7 @@
title="{{
id ? ('SMTP.DETAIL.TITLE' | translate) : ('SMTP.CREATE.STEPS.TITLE' | translate: { value: providerDefaultSetting.name })
}}"
- [createSteps]="3"
+ [createSteps]="4"
[currentCreateStep]="currentCreateStep"
(closed)="close()"
>
@@ -93,7 +93,7 @@
[disabled]="firstFormGroup.invalid"
color="primary"
matStepperNext
- data-e2e="continue-button"
+ data-e2e="continue-to-2nd-form"
>
{{ 'ACTIONS.CONTINUE' | translate }}
@@ -130,19 +130,74 @@
+
+
+
+