Elgg  Version 6.0
Go to the documentation of this file.
1 <?php
3 namespace Elgg\Email;
19  public function __invoke(\Elgg\Event $event): void {
20  $user = $event->getUserParam();
21  if (!$user instanceof \ElggUser || !$user->canEdit() || !(bool) elgg_get_config('enable_delayed_email')) {
22  return;
23  }
25  $delayed_email_interval = get_input('delayed_email_interval');
26  if (empty($delayed_email_interval)) {
27  return;
28  }
30  if ($user->delayed_email_interval === $delayed_email_interval) {
31  // no change
32  return;
33  }
35  // save new setting
36  $user->delayed_email_interval = $delayed_email_interval;
38  // update all queued notifications to the new interval
39  _elgg_services()->delayedEmailQueueTable->updateRecipientInterval($user->guid, $delayed_email_interval);
40  }
41 }
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
Save the user setting for delayed email interval.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE.txt:215
__invoke(\Elgg\Event $event)
Handle the saving of the user settings.
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
Definition: ban.php:7
Get the global service provider.
Definition: elgglib.php:351
Models an event passed to event handlers.
Definition: Event.php:11