Skip to content

Feature contact group send#2414

Merged
ChristophWurst merged 3 commits into
nextcloud:masterfrom
bfritscher:feature-contact-group-send
Jan 16, 2020
Merged

Feature contact group send#2414
ChristophWurst merged 3 commits into
nextcloud:masterfrom
bfritscher:feature-contact-group-send

Conversation

@bfritscher

@bfritscher bfritscher commented Dec 29, 2019

Copy link
Copy Markdown
Contributor

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:

  • To which email of the contact do we send? first or all?
  • Should we hide the expansion in the BCC field?
  • GroupService only seems to use email field no label?

Fixes #41

@welcome

welcome Bot commented Dec 29, 2019

Copy link
Copy Markdown

Thanks for opening your first pull request in this repository! ✌️

@jancborchardt

Copy link
Copy Markdown
Member

@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! :)

@bfritscher bfritscher force-pushed the feature-contact-group-send branch from 5f2fc32 to 6bdc2ec Compare December 30, 2019 09:22
@bfritscher

Copy link
Copy Markdown
Contributor Author

@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.

contactgroup_autocomplete

@jancborchardt

Copy link
Copy Markdown
Member

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)". :)

@ChristophWurst

Copy link
Copy Markdown
Member

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 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.

Code looks good otherwise. Thanks for also adding tests!

if (!isset($r['EMAIL'])) {
continue;
}
$groups = preg_split('/,/', $r['CATEGORIES']);

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 might return false

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.

why not just use explode?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point missed explode when looking through the api. Long time since I coded in php.

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.

No worries :)

@jancborchardt

Copy link
Copy Markdown
Member

Then my only feedback is to simply append "(group)" instead of the quite technical "(ContactGroup)". :)

That makes it ambiguous. It should be "Contacts" IMO.

Alright, that seems good. :)

Comment thread lib/AppInfo/Application.php Outdated
use OCA\Mail\Service\AvatarService;
use OCA\Mail\Service\Group\IGroupService;
use OCA\Mail\Service\Group\NextcloudGroupService;
use OCA\Mail\Service\Group\ContactsGroupService;

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.

actually not used here. you may also remove the two other group service imports

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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?

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, that is absolutely correct :)

Bildschirmfoto von 2020-01-08 10-54-28

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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>
@bfritscher bfritscher force-pushed the feature-contact-group-send branch from e13a331 to 7de5e5f Compare January 8, 2020 16:47
Signed-off-by: Boris Fritscher <boris@fritscher.ch>
@ChristophWurst

Copy link
Copy Markdown
Member

To which email of the contact do we send? first or all?

Good question. Let's send to all of them.

Should we hide the expansion in the BCC field?

No, I think there can be cases where you want to use a group for BCC.

GroupService only seems to use email field no label?

IIRC we just fall back to email as label if no label is set.

}

$email = $r['EMAIL'];
// only take first email ?

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.

as commented, I think we should just use all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok changed it to iterate through all emails

@dieter-wilhelm dieter-wilhelm Jan 18, 2020

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 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.

Looks good otherwise and works as advertised :)

Thanks a lot!

Signed-off-by: Boris Fritscher <boris@fritscher.ch>

@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.

Great work!

@ChristophWurst

Copy link
Copy Markdown
Member

Will integrate once CI passes. Restarted a few jobs. Looks like it was a hiccup with the Docker service.

@ChristophWurst ChristophWurst merged commit 9ff714a into nextcloud:master Jan 16, 2020
@dieter-wilhelm

Copy link
Copy Markdown

To which email of the contact do we send? first or all?

Good question. Let's send to all of them.

I would suggest the first one (supposedly the "favourite" one)

Should we hide the expansion in the BCC field?

No, I think there can be cases where you want to use a group for BCC.

yes, I think for this "group" functionality BCC is the most import field with regards to privacy

GroupService only seems to use email field no label?

IIRC we just fall back to email as label if no label is set.

Pardon, what does "label" mean in this context?

thank you for your work and please tell me when this feature will be available.

@ChristophWurst

Copy link
Copy Markdown
Member

I would suggest the first one (supposedly the "favourite" one)

Open a ticket to discuss.

Pardon, what does "label" mean in this context?

It's a detail of the UI code. Like what we use for the user-visible text on each entry.

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.

Sending to groups [$150 awarded]

4 participants