-
Notifications
You must be signed in to change notification settings - Fork 696
feat(settings): select Email Domain for custom email accounts #2850
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(settings): select Email Domain for custom email accounts #2850
Conversation
|
@artykbasar |
Helpdesk.custom.email.providermov.-.1080WebShareName.mov |
|
@RitvikSardana I have done screen recording of the ui changes, I hope it will be easy to see. If you cannot see it, let me know I will upload screenshots as well. |
|
Hello @artykbasar
Both SSL and TLS settings are available for both Incoming and Outgoing Would suggest to add SSL and TLS After Incoming Port Field and label it as "Use SSL for Incoming" similarly add these after "Outgoing" Port as well. "Use SSL for Outgoing" |
| import EmailProviderIcon from "./EmailProviderIcon.vue"; | ||
| import { __ } from "@/translation"; | ||
| import SettingsLayoutBase from "@/components/layouts/SettingsLayoutBase.vue"; | ||
| import { Link } from "@/components"; |
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.
Use Link component from frappe-ui
Will not need Clear button then
| const { updateOnboardingStep } = useOnboarding("helpdesk"); | ||
|
|
||
| const state: Reactive<EmailAccount> = reactive({ | ||
| const state = reactive<EmailAccountFormState>({ |
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.
Use different state variable instead of using the same for Custom Domains
A lot of unwanted data is sent to the backend in case of Gmail or some Popular Providers.
| import SettingsLayoutBase from "@/components/layouts/SettingsLayoutBase.vue"; | ||
| import { Link } from "@/components"; | ||
|
|
||
| type EmailAccountFormState = { |
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.
Use different type which maybe can be extended from this
| watch( | ||
| () => state.domain, | ||
| async (val) => { | ||
| if (!val) return; |
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.
can add another early return if email account selected is not Custom
| </span> | ||
| <span v-if="deskEditUrl" class="flex items-center gap-1"> | ||
| <a :href="deskEditUrl" target="_blank" class="text-ink-blue-2 underline"> | ||
| {{ __('Open in Desk') }} |
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.
https://docs.frappe.io/erpnext/user/manual/en/email-domain
this link should be used
Read more about it
helpdesk/api/settings/email.py
Outdated
| "use_ssl": 1, | ||
| "smtp_server": "smtp-mail.outlook.com", | ||
| }, | ||
| "Outlook.com": { # backwards-compatible alias |
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.
Please explain this with some context of backwards compatibility
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.
Hi Ritvik — good question.
I added the Outlook.com / Yahoo Mail / Yandex.Mail entries because those exact strings are already used by Frappe’s Email Account DocType in Desk, and many existing installations can have Email Account records stored with those values in the service field.
In Helpdesk Settings UI we show the providers as Outlook, Yahoo, and Yandex. If someone already has an Email Account created in Desk with service = "Outlook.com" (for example), Helpdesk’s backend lookup (email_service_config.get(service)) won’t match it unless we handle that variant — which can lead to “service not supported” or missing defaults.
So these are simply aliases that treat those stored values the same as the equivalent provider, so older/existing records work smoothly.
If you prefer, I can update the inline comment to be more explicit, e.g.:
Alias for service values already stored by Desk/Email Account (
Outlook.com,Yahoo Mail,Yandex.Mail).
|
Also pull latest changes |
- Add Email Domain link field for Custom provider and auto-fill server settings - Open Email Domain/Email Account in Desk for create/edit - Avoid sending Custom-domain fields for non-Custom providers - Add service aliases for legacy Email Account service values (e.g. Outlook.com, Yahoo Mail, Yandex.Mail)
a2a8044 to
43038ec
Compare
|
Hi @RitvikSardana, thanks for the detailed review 🙏 I’ve addressed all the feedback and squashed the changes into a single clean commit ( Summary of updates
The branch is now rebased on latest |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2850 +/- ##
===========================================
+ Coverage 50.54% 50.56% +0.01%
===========================================
Files 122 122
Lines 5403 5403
===========================================
+ Hits 2731 2732 +1
+ Misses 2672 2671 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you so much for this feature @artykbasar 🙏🏻 |


Summary
Adds Email Domain support for Custom email accounts in Helpdesk Settings. You can now select an existing Email Domain while creating/editing a Custom account; selecting a domain auto-fills the IMAP/SMTP server, ports, and SSL-related fields. Domain creation/editing is delegated to Desk to avoid duplicating DocType UI inside Helpdesk.
What changed
UI (Helpdesk Settings → Email Accounts)
/desk/email-domain/new-email-domain/desk/email-domain/<domain>Validation
Backend (helpdesk/api/settings/email.py)
Outlook.com,Yahoo Mail,Yandex.Mail(alongside existing labels)Why
Previously, Custom-domain accounts configured via Desk could result in a broken/blank experience in Helpdesk Settings and were not manageable from the Helpdesk UI. This change makes Custom email accounts configurable in Helpdesk while still leveraging the canonical Desk DocTypes.
Manual testing
Issue
Fixes #2635
Helpdesk.custom.email.providermov.-.1080WebShareName.mov