Skip to content

feat: warn users when sending email with empty to field#13152

Draft
steven-mpawulo wants to merge 3 commits into
nextcloud:mainfrom
steven-mpawulo:enhancement/13094-warn-empty-to-field
Draft

feat: warn users when sending email with empty to field#13152
steven-mpawulo wants to merge 3 commits into
nextcloud:mainfrom
steven-mpawulo:enhancement/13094-warn-empty-to-field

Conversation

@steven-mpawulo

Copy link
Copy Markdown
Collaborator

Show a warning when the To field is empty during the sending of an email.

fixes #13094.

Signed-off-by: steven-mpawulo <stevenmpawulo@gmail.com>

@ChristophWurst ChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for looking into this, @steven-mpawulo!

Comment thread src/components/Composer.vue Outdated
async onSend() {

if (this.selectTo.length === 0) {
showWarning(t('mail', 'The email has no visible ‘To’ recipients. Some mail providers may reject this message.'))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The type of warning discussed in #13094 is a conditionally rendered text underneath the recipient input.

It would be something like the helper text of NcTextField https://nextcloud-vue-components.netlify.app/#/Components/NcFields?id=nctextfield but for the NcSelect component. NcSelect might not have this feature at the moment.

@steven-mpawulo steven-mpawulo Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I see. I initially thought you meant displaying an actual warning toast.
For this case, would it be okay to use a simple <p> element below the NcSelect as helper text and style it accordingly, since NcSelect doesn't seem to support helper text like NcTextField does at the moment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, sounds good as workaround.

I've created nextcloud-libraries/nextcloud-vue#8669 to track the missing feature. If we add this later we can switch.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Awesome.
Let me update

@ChristophWurst ChristophWurst marked this pull request as draft June 24, 2026 12:54
Comment thread src/components/Composer.vue Outdated
</NcSelect>
</div>
<div v-if="displayMissingToWarning">
<p class="to-warning">{{ t('mail', 'The email has no visible ‘To’ recipients. Some mail providers may reject this message') }}</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We use the BEM structure for classes. Perhaps this could be a composer-fields__helper-text

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Noted.
Let me update this.

Comment thread src/components/Composer.vue Outdated

if (this.selectTo.length === 0) {
this.displayMissingToWarning = true
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This happens too late. The warning text should be shown every time there are no direct recipients.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I also considered this but initially ignored it. I’ll update it now.

@steven-mpawulo steven-mpawulo force-pushed the enhancement/13094-warn-empty-to-field branch from c4d59c7 to 0ad3191 Compare June 24, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn user when sending email with empty "To" field

2 participants