method addContactFromMail documentation in bbn\User\Email
function(array $dest, bool $blacklist = false)
{
if (X::hasProp($dest, 'email', true)) {
$cfg_contacts = $this->class_cfg['arch']['users_contacts'];
$cfg_links = $this->class_cfg['arch']['users_contacts_links'];
$table_contacts = $this->class_cfg['tables']['users_contacts'];
$table_links = $this->class_cfg['tables']['users_contacts_links'];
if ($this->db->insert($table_contacts, [
$cfg_contacts['id_user'] => $this->user->getId(),
$cfg_contacts['name'] => empty($dest['name']) ? null : mb_substr($dest['name'], 0, 100),
$cfg_contacts['blacklist'] => $blacklist ? 1 : 0
])) {
$id_contact = $this->db->lastId();
if ($this->db->insert($table_links, [
'id_contact' => $id_contact,
'type' => 'email',
'value' => $dest['email']
])) {
return $this->db->lastId();
}
}
}
return null;
}
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions