MailProvider.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Settings\Settings\Admin;
  8. use OCP\IL10N;
  9. use OCP\Settings\DeclarativeSettingsTypes;
  10. use OCP\Settings\IDeclarativeSettingsForm;
  11. class MailProvider implements IDeclarativeSettingsForm {
  12. public function __construct(
  13. private IL10N $l,
  14. ) {
  15. }
  16. public function getSchema(): array {
  17. return [
  18. 'id' => 'mail-provider-support',
  19. 'priority' => 10,
  20. 'section_type' => DeclarativeSettingsTypes::SECTION_TYPE_ADMIN,
  21. 'section_id' => 'server',
  22. 'storage_type' => DeclarativeSettingsTypes::STORAGE_TYPE_EXTERNAL,
  23. 'title' => $this->l->t('Mail Providers'),
  24. 'description' => $this->l->t('Mail provider enables sending emails directly through the user\'s personal email account. At present, this functionality is limited to calendar invitations. It requires Nextcloud Mail 4.1 and an email account in Nextcloud Mail that matches the user\'s email address in Nextcloud.'),
  25. 'fields' => [
  26. [
  27. 'id' => 'mail_providers_enabled',
  28. 'title' => $this->l->t('Send emails using'),
  29. 'type' => DeclarativeSettingsTypes::RADIO,
  30. 'default' => 1,
  31. 'options' => [
  32. [
  33. 'name' => $this->l->t('Users\'s email account'),
  34. 'value' => 1
  35. ],
  36. [
  37. 'name' => $this->l->t('System email account'),
  38. 'value' => 0
  39. ],
  40. ],
  41. ],
  42. ],
  43. ];
  44. }
  45. }