method delete documentation in bbn\Appui\Mailing
Deletes the mailing and relative emails.
function(string $id)
{
// We do not delete mailings which have been sent
if ($this->countSent($id)) {
//return 0;
}
$success = null;
$mailing = $this->getMailing($id);
if (!empty($mailing['id_note'])) {
$notes = $this->_note();
//if the notes has media removes media before to remove the note
if ($medias = $notes->getMedias($mailing['id_note'])) {
foreach ($medias as $media){
$notes->removeMedia($media['id'], $mailing['id_note']);
}
}
// if there are emails with the given id_mailing
if ($this->db->count('bbn_emails', ['id_mailing' => $id])) {
//it removes the emails ready or cancelled relative to this id_mailing
$this->deleteAllEmails($id);
}
if (!$this->db->count('bbn_emails', ['id_mailing' => $id])) {
//deletes the row
$success = $this->db->delete("bbn_emailings", ['id' => $id]);
//$notes->remove($mailing['id_note']);
}
}
return $success;
}
Deletes the mailing and relative emails. 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-2023
BBN Solutions