-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(sharebymail): Use initiator's email as sender if mail providers enabled #57080
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -314,6 +314,38 @@ public static function getDefaultEmailAddress(string $user_part): string { | |||||
| return $user_part . '@localhost.localdomain'; | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Returns the email address for the given user | ||||||
| * @param IUser|null $user | ||||||
| * @param string $fallback_user_part the fallback address part | ||||||
| * @return string the email address | ||||||
| * | ||||||
| * If mail providers are enabled, uses the specified user's email address. | ||||||
| * If disabled or the user has no valid email, falls back to the system default. | ||||||
| * @since 31.0.12 | ||||||
| */ | ||||||
| public static function getEmailAddressForUser(?IUser $user, string $fallback_user_part): string { | ||||||
|
||||||
| if ($user === null) { | ||||||
| return self::getDefaultEmailAddress($fallback_user_part); | ||||||
| } | ||||||
|
|
||||||
| $config = \OCP\Server::get(serviceName: IConfig::class); | ||||||
|
||||||
|
|
||||||
| $mailProvidersEnabled = $config->getAppValue('core', 'mail_providers_enabled', '0') === '1'; | ||||||
|
||||||
| $mailProvidersEnabled = $config->getAppValue('core', 'mail_providers_enabled', '0') === '1'; | |
| $mailProvidersEnabled = $appConfig->getValueBool('core', 'mail_providers_enabled', true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.