Skip to content

Commit

Permalink
Fix command event bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightbr committed Jun 29, 2017
1 parent ba842c9 commit d56f535
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Command/EventCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
*/
$manager = $this->getContainer()->get('mailjet.service.event_callback_manager');

if($input->getOption('event-type')){
if ($input->getOption('event-type')) {
$eventTypes = $input->getOption('event-type');
}else{
} else {
$eventTypes = ["sent", "open", "click", "bounce", "blocked", "spam", "unsub"];
}

Expand All @@ -57,14 +57,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$manager->get($eventType);
$output->writeln('update '.$eventType);
$manager->update($eventType, $eventCallBackUrl);
} catch (\RuntimeException $e) {
} catch (\Exception $e) {
$output->writeln('create '.$eventType);
$manager->create($eventCallBackUrl);
}
}

$output->writeln(sprintf('<info>%s callback url has been added to your Mailjet account!</info>', $url));

}

/**
Expand Down

0 comments on commit d56f535

Please sign in to comment.