feat: warn users when sending email with empty to field#13152
feat: warn users when sending email with empty to field#13152steven-mpawulo wants to merge 3 commits into
Conversation
Signed-off-by: steven-mpawulo <stevenmpawulo@gmail.com>
ChristophWurst
left a comment
There was a problem hiding this comment.
Thank you for looking into this, @steven-mpawulo!
| async onSend() { | ||
|
|
||
| if (this.selectTo.length === 0) { | ||
| showWarning(t('mail', 'The email has no visible ‘To’ recipients. Some mail providers may reject this message.')) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Awesome.
Let me update
| </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> |
There was a problem hiding this comment.
We use the BEM structure for classes. Perhaps this could be a composer-fields__helper-text
There was a problem hiding this comment.
Noted.
Let me update this.
|
|
||
| if (this.selectTo.length === 0) { | ||
| this.displayMissingToWarning = true | ||
| } |
There was a problem hiding this comment.
This happens too late. The warning text should be shown every time there are no direct recipients.
There was a problem hiding this comment.
I also considered this but initially ignored it. I’ll update it now.
c4d59c7 to
0ad3191
Compare
…te instead of send-time flag
Show a warning when the To field is empty during the sending of an email.
fixes #13094.