92 $email->setFrom(self::prepareFrom($from));
101 if (isset(
$params[
'attachments']) && is_array(
$params[
'attachments'])) {
102 foreach (
$params[
'attachments'] as $attachment) {
103 $email->addAttachment($attachment);
118 $this->sender = $sender;
128 return $this->sender;
160 $this->to = $this->prepareRecipients(
$recipient);
181 $this->cc = $this->prepareRecipients(
$recipient);
202 $this->bcc = $this->prepareRecipients(
$recipient);
325 if ($attachment instanceof Part) {
326 $this->attachments[] = $attachment;
330 if ($attachment instanceof \
ElggFile) {
331 $this->attachments[] = Attachment::fromElggFile($attachment);
335 $attachment = Attachment::factory($attachment);
336 if (!empty($attachment)) {
337 $this->attachments[] = $attachment;
363 if ($add_microtime) {
364 $microtime =
'.' . microtime(
true);
370 return "{$urlPath}.entity.{$entity->guid}{$microtime}@{$hostname}";
389 $from =
new Address($from->getEmailAddress(), $from->getDisplayName());
392 if (!$from instanceof \
ElggUser && $from->email) {
393 $from = Address::fromEntity($from);
397 $from_display =
elgg_echo(
'notification:method:email:from', [$from->getDisplayName(),
$site->getDisplayName()]);
398 $from =
new Address(
$site->getEmailAddress(), $from_display);
400 }
elseif (is_string($from)) {
401 $from = Address::fromString($from);
404 if (!$from instanceof
Address) {
421 if (empty($recipients)) {
425 if (!is_array($recipients)) {
426 $recipients = [$recipients];
if(! $user||! $user->canDelete()) $name
$params
Saves global plugin settings.
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
$attachments
Outputs attachments.
createEntityMessageID(\ElggEntity $entity, bool $add_microtime=false)
Create a Message-ID header string for the given entity.
setSubject($subject='')
Sets email subject.
addHeader($name, $value)
Adds/replaces an HTTP/IMF header.
getSubject()
Returns the subject.
getSender()
Returns sender.
addAttachment($attachment)
Add an attachment.
static prepareFrom($from)
Converts mixed input to an instance of Laminas addres.
setFrom(Address $from)
Sets sender address.
getAttachments()
Get all attachments.
getFrom()
Returns sender address.
static factory(array $options=[])
Create an email instance form an array of options.
getHeaders()
Returns headers.
getBody()
Returns email body.
getCc()
Returns recipient address from cc.
setHeaders(array $headers=[])
Replaces header bag.
prepareRecipients($recipients)
Converts mixed input to an array of Laminas address instances.
setSender($sender)
Sets email sender.
getTo()
Returns recipient address.
setCc($recipient)
Sets recipient address in cc.
getBcc()
Returns recipient address from bcc.
setParams(array $params=[])
Sets additional params.
setTo($recipient)
Sets recipient address.
setBcc($recipient)
Sets recipient address in bcc.
getParams()
Returns additional params.
setBody($body='')
Sets the email message body.
Exception thrown if an argument is not of the expected type.
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
if($who_can_change_language==='nobody') elseif($who_can_change_language==='admin_only' &&!elgg_is_admin_logged_in()) $options
if($item instanceof \ElggEntity) elseif($item instanceof \ElggRiverItem) elseif($item instanceof \ElggRelationship) elseif(is_callable([ $item, 'getType']))
_elgg_services()
Get the global service provider.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_get_site_entity()
Get the current site entity.
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
elgg_substr()
Wrapper function for mb_substr().