Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adding update command so emails are inserted to database #5

Open
wants to merge 1 commit into
base: FRAMEWORK_6_0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions lib/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,19 @@ public function blacklistFrom($addresses)
}

try {
$injector->getInstance('Ingo_Factory_Storage')->create()
->getSystemRule('Ingo_Rule_System_Blacklist')
->addAddresses($addresses);
$ingo_storage = $injector->getInstance('Ingo_Factory_Storage')->create();
$bl = $ingo_storage->getSystemRule('Ingo_Rule_System_Blacklist');
$bl->addAddresses($addresses);
$ingo_storage->updateRule($bl);
$injector->getInstance('Ingo_Factory_Script')->activateAll(false);
foreach ($addresses as $from) {
$notification->push(sprintf(_("The address \"%s\" has been added to your blacklist."), $from));
if (is_iterable($addresses))
{
foreach ($addresses as $from) {
$notification->push(sprintf(_("The address \"%s\" has been added to your blacklist."), $from));
}
}
else {
$notification->push(sprintf(_("The address \"%s\" has been added to your blacklist."), $addresses));
}
} catch (Ingo_Exception $e) {
$notification->push($e);
Expand Down