Feature contact group send#2414
Conversation
|
Thanks for opening your first pull request in this repository! ✌️ |
|
@bfritscher hello and welcome to Nextcloud Mail! :) Could you add some screenshots so people see how to test? And it also helps a lot with design review – thanks! :) |
5f2fc32 to
6bdc2ec
Compare
|
@jancborchardt thanks! There is not a lot to see I used the existing group autocomplete. And used it to add contact group autocomplete. So now in the mail's To field the autocomplete also provides group names from contacts. The entry is marked as (ContactGroup) instead of (nextcloud) which is for internal groups. On send the entry is expanded to all emails by the GroupsIntegration provided by @myrho in #810. |
|
Ah right, and ContactGroup means a group as per the Contacts app, right? Then my only feedback is to simply append "(group)" instead of the quite technical "(ContactGroup)". :) |
That makes it ambiguous. It should be "Contacts" IMO. |
ChristophWurst
left a comment
There was a problem hiding this comment.
Code looks good otherwise. Thanks for also adding tests!
| if (!isset($r['EMAIL'])) { | ||
| continue; | ||
| } | ||
| $groups = preg_split('/,/', $r['CATEGORIES']); |
There was a problem hiding this comment.
why not just use explode?
There was a problem hiding this comment.
Good point missed explode when looking through the api. Long time since I coded in php.
Alright, that seems good. :) |
| use OCA\Mail\Service\AvatarService; | ||
| use OCA\Mail\Service\Group\IGroupService; | ||
| use OCA\Mail\Service\Group\NextcloudGroupService; | ||
| use OCA\Mail\Service\Group\ContactsGroupService; |
There was a problem hiding this comment.
actually not used here. you may also remove the two other group service imports
There was a problem hiding this comment.
I do not yet get everything about use, but if its like imports it seems to me that since d18ef16 when BootstrapSingleton was created only App is really used? And everything else was moved to Bootstrap?
There was a problem hiding this comment.
Ok I squashed my edits into one commit and made a second one for the cleanup of the imports in applications. Do you need it on a different pull request?
By adding a new GroupService implementation and copying some code of the ContactsIntegration.php Signed-off-by: Boris Fritscher <boris@fritscher.ch>
e13a331 to
7de5e5f
Compare
Signed-off-by: Boris Fritscher <boris@fritscher.ch>
7de5e5f to
e1d5256
Compare
Good question. Let's send to all of them.
No, I think there can be cases where you want to use a group for BCC.
IIRC we just fall back to email as label if no label is set. |
| } | ||
|
|
||
| $email = $r['EMAIL']; | ||
| // only take first email ? |
There was a problem hiding this comment.
as commented, I think we should just use all.
There was a problem hiding this comment.
ok changed it to iterate through all emails
There was a problem hiding this comment.
I wouldn't iterate over all email addresses for a specific contact, often contacts have employer mail addresses or mail addresses for different purposes. I would just use the first mail address, which is supposed to be the favourite or public mail address of the respective contact.
ChristophWurst
left a comment
There was a problem hiding this comment.
Looks good otherwise and works as advertised :)
Thanks a lot!
Signed-off-by: Boris Fritscher <boris@fritscher.ch>
|
Will integrate once CI passes. Restarted a few jobs. Looks like it was a hiccup with the Docker service. |
I would suggest the first one (supposedly the "favourite" one)
yes, I think for this "group" functionality BCC is the most import field with regards to privacy
Pardon, what does "label" mean in this context? thank you for your work and please tell me when this feature will be available. |
Open a ticket to discuss.
It's a detail of the UI code. Like what we use for the user-visible text on each entry. |


Test of implementing contact group lookup and expansion
By adding a new GroupService implementation and copying some code of the ContactsIntegration.php
This is a first attempt to fix issue #41 . Some open questions I identified the following open issues:
Fixes #41