-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Primary/Notification email address implementation plan #27465
Comments
So "primary" is user selected, "system" is LDAP source or not changable because of config. |
In Mail we use the user's email address as template argument for %EMAIL% when email addresses and usernames are built for provisioned accounts. For those features the system mail doesn't make any sense. Ref https://github.com/nextcloud/mail/blob/574f1f010106cb850c6a4f0eeff3a0a815593a10/lib/Db/Provisioning.php#L142. Hence a dedicated method that only gives you the user's email address or null would be preferred. For the account form we get the email address like this: https://github.com/nextcloud/mail/blob/574f1f010106cb850c6a4f0eeff3a0a815593a10/lib/Controller/PageController.php#L168 -> what value can we expect there int the future? Should such code also use |
Right, I skipped explaining terminology for shagginess. "Primary email" is the user-chosen email address, that should be used for notifications and things. The "system email" is that one set the backend or administrator (scenario for local users is when |
Right now what you are getting is the system mail (the only mail we have as speak). For provisioned accounts imo the only useful value to use is the mail set by admin/backend i.e. system mail. So my suggestion would be to switch for the specific system mail getter.
What you're using there is the current implementation of |
It appears I neglected the fact that this method is being used by other user backends as well to actually set the mail. In this case the user backend has the authority and shall set or overwrite the system email indeed. For APIs and apps not to break, the current situation must continue to work, so the |
While implementing, I simplified the setEmailAddress to be an alias to the set the system email address (best backwards compatibility). For the reasons stated above ^ Only the user should be able to set the primary/notification email, hence i adjusted the API Controller to do exactly this. |
This is part of #26866
My original intent was
And I thought this is a quick win, but it turns out this has more side effects than originally anticipated. My drafted idea now:
getEmailAddress
is fairly easy
setEmailAddress
is partly surprising and more complex
here it has to be said that the name
allow_user_to_change_display_name
is misleading as it controls whether a user may or may not set their email address in the UI. This is enforced in the controllers only.Another aspect is that at the moment an (old style)
::changeUser
event is triggered, when the email address has changed. This should continue to run, but only for when the system mail has changed.If there is interest (as in: a use case) we can introduce an event for the primaryMail change, too.
more methods
IUser
should be equipped with methods to specifically fetch the system or primary mail when a clear value is necessary. For instance in the user:info occ command, which should right away make use of it.The users management page may show the primary address as well, I would consider it not critical there.
Addendum
This requires implementation of local mail verification which is still on the todo list.
Opinions?
@Pytal @skjnldsv @nickvergessen @ChristophWurst @icewind1991
The text was updated successfully, but these errors were encountered: