Skip to content
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

Mail is send as somebody when using Circles #1447

Open
Gerben-W opened this issue Nov 30, 2023 · 7 comments
Open

Mail is send as somebody when using Circles #1447

Gerben-W opened this issue Nov 30, 2023 · 7 comments

Comments

@Gerben-W
Copy link

Gerben-W commented Nov 30, 2023

When sharing files with a single mail address, the subject of the mail contains the user that shares this file.
( USERNAME shared »FILENAME« with you )

But when sharing to a Circle, the subject of the mail contains "someone".
( someone shared a file with you. )

Is it possible to change the mail subject so that the username is in the subject just like sharing a file with a single mail address?

@Gerben-W Gerben-W changed the title Mail is send as somebody Mail is send as somebody when using Circles Dec 19, 2023
@Noki77
Copy link

Noki77 commented Feb 8, 2024

I diagnosed this a fair bit now, as i saw this behaviour as well after a sharing attempt of one of our customers bounced...
seems like the issue is caused by ShareWrapper::hasInitiator returning false in ShareCreatedSendMail.php#L165, though I haven't figured out why yet...
In my case I "fixed" the issue by simply replacing "someone" within the mail subject by using an event listener on the BeforeMessageSent Event in a custom NextCloud App, that i'm using anyway for having certain email templates based on the user mail address or groups.

So if you still want to "fix" this yourself and you're willing to go through the effort of making an own NC app for it, here is basically what you need to do:

  • Create a custom app (just follow the docs or use the app skeleton generator by NextCloud)
  • write an event listener on \OCA\Circles\Events\AddingCircleMemberEvent, that fetches the circle owner and stores it somewhere (in my case I have an Application::setDispatchingUser function
  • write an event listener on OCP\Mail\Events\BeforeMessageSent that first checks whether a circle owner was found earlier (in my case just check whether Application::getDispatchingUser() is not null), then whether $event->getMessage()->getSubject() contains the word "someone" (yes, IMessage doesn't have a getSubject() function, but \OC\Mail\Message does, maybe check if it's an instance of it first) and lastly replace "someone" with the previously fetched circle owners' display name
  • register both listeners in your Application::register method

Edit: since I did this stuff anyway, I published an app adding the workaround here: https://github.com/Noki77/workaround_circles_mails

@Gerben-W
Copy link
Author

Gerben-W commented Mar 4, 2024

@Noki77 Thanks for helping with this.
Loved your solution and thinking of implementing this.
Unfortunately I only have one concern you might be able to help with.
In the mail which is send out, the body contains the Circle name, which can be anything (even non positive names to group a certain amount of people). Do you know how to easily replace the circle name with the word "you" in the mail that is send out.
Basically that the mail looks more like the standard mail that is send to one person in stead of a Circle.

Thank you.

@Noki77
Copy link

Noki77 commented Mar 4, 2024

@Gerben-W happy to hear it works out for you!
Good idea with the circle name, i'll look into how it could be implemented.

@spanje
Copy link

spanje commented Mar 26, 2024

@Noki77 : It would be really great if you could implement this :-)

@Jerome-Herbinet
Copy link
Member

Jerome-Herbinet commented Aug 21, 2024

I'm still having that problem with the last contacts + teams apps in NC 29. Mail is sent by "someone" (in e-mails subject an body). That's pretty weird and may damage UX. @ArtificialOwl or @nickvergessen, what do you think ?

Here is what I get (IMO, the share issuer should be indicated instead of "someone", because without that information, some recipients could suspect spamming) :

2024-08-21_14-29
2024-08-21_14-30

It may be interesting to work on this at the same moment as #1239

@nickvergessen
Copy link
Member

I can point you to the search results:


String is not translated and even if translated it should not be inserted into a string like that as it might not work in every language.

But I'm not the maintainer of the app, so I'm unsubscribing again

@Jerome-Herbinet
Copy link
Member

I can point you to the search results:

String is not translated and even if translated it should not be inserted into a string like that as it might not work in every language.

But I'm not the maintainer of the app, so I'm unsubscribing again

How can I get the maintainers' list of an app, in order to ping the right persons ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants