12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace OC\Contacts\ContactsMenu\Providers;
- use OCP\Contacts\ContactsMenu\IActionFactory;
- use OCP\Contacts\ContactsMenu\IEntry;
- use OCP\Contacts\ContactsMenu\IProvider;
- use OCP\IURLGenerator;
- class EMailProvider implements IProvider {
- public function __construct(
- private IActionFactory $actionFactory,
- private IURLGenerator $urlGenerator,
- ) {
- }
- public function process(IEntry $entry): void {
- $iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/mail.svg'));
- foreach ($entry->getEMailAddresses() as $address) {
- if (empty($address)) {
-
- continue;
- }
- $action = $this->actionFactory->newEMailAction($iconUrl, $address, $address, 'email');
- $entry->addAction($action);
- }
- }
- }
|