Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/sharebymail/lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function __construct(
public function getForm() {
$this->initialState->provideInitialState('sendPasswordMail', $this->settingsManager->sendPasswordByMail());
$this->initialState->provideInitialState('replyToInitiator', $this->settingsManager->replyToInitiator());
$this->initialState->provideInitialState('useUserEmail', $this->settingsManager->useUserEmail());

Util::addStyle('sharebymail', 'admin-settings');
Util::addScript('sharebymail', 'admin-settings');
Expand Down Expand Up @@ -67,6 +68,7 @@ public function getAuthorizedAppConfig(): array {
'sharebymail' => [
'sendpasswordmail',
'replyToInitiator',
'useUserEmail',
],
];
}
Expand Down
18 changes: 18 additions & 0 deletions apps/sharebymail/lib/Settings/SettingsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class SettingsManager {

private $replyToInitiatorDefault = 'yes';

private $useUserEmailDefault = 'no';

public function __construct(
private IConfig $config,
) {
Expand All @@ -41,4 +43,20 @@ public function replyToInitiator(): bool {
$replyToInitiator = $this->config->getAppValue('sharebymail', 'replyToInitiator', $this->replyToInitiatorDefault);
return $replyToInitiator === 'yes';
}

/**
* Should share-by-mail emails be sent using the user's personal email
* address (via Mail Provider) instead of the global system email address.
*
* When enabled and a Mail Provider is available for the user, share
* notification emails will be sent from the user's own address, similar
* to how calendar invitations work.
*
* @return bool
* @psalm-suppress DeprecatedMethod
*/
public function useUserEmail(): bool {
$useUserEmail = $this->config->getAppValue('sharebymail', 'useUserEmail', $this->useUserEmailDefault);
return $useUserEmail === 'yes';
}
}
Loading