if(!$item instanceof\ElggRiverItem) $metadata
if(!isset($metadata)) if(!empty($metadata)) $timestamp
if(!empty($timestamp)) $summary
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if(!empty($message)) $attachments
if(!empty($attachments)) $responses
if($email instanceof\Elgg\Email) $object
if(!empty($summary)) $message