23 if (!is_array($prefered_methods)) {
24 $prefered_methods = [];
28 $user->setNotificationSetting($method, in_array($method, $prefered_methods),
$purpose);
34 $delayed_email_interval = (string)
get_input(
'delayed_email_interval');
35 if (!empty($delayed_email_interval) &&
$user->delayed_email_interval !== $delayed_email_interval) {
37 $user->delayed_email_interval = $delayed_email_interval;
40 _elgg_services()->delayedEmailQueueTable->updateRecipientInterval(
$user->guid, $delayed_email_interval);
49 $end_date = Values::normalizeTime(
$end);
50 $end_date->setTime(23, 59, 59);
51 $end = $end_date->getTimestamp();
56 unset(
$user->timed_muting_start);
57 unset(
$user->timed_muting_end);
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
if(!$user instanceof ElggUser||!$user->canEdit()) $methods
Saves user notification settings.
elgg_ok_response($content= '', string|array $message= '', string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
foreach($notification_settings as $purpose=> $prefered_methods) if((bool) elgg_get_config('enable_delayed_email')) $start
elgg_error_response(string|array $message= '', string $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
get_user(int $guid)
Elgg users Functions to manage multiple or single users in an Elgg install.
_elgg_services()
Get the global service provider.
elgg_get_notification_methods()
Returns registered delivery methods for notifications [ 'email' => 'email', 'sms' => 'sms'...
if(empty($methods)) $notification_settings