Skip to content

Commit

Permalink
change status after resend
Browse files Browse the repository at this point in the history
  • Loading branch information
haitv282 committed Jun 7, 2018
1 parent 47a266d commit 74f8861
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Model/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ public function _construct()
*/
public function saveLog($message, $status)
{
if ($this->_registry->registry('mp_smtp_resend')) {
if ($logId = $this->_registry->registry('mp_smtp_resend')) {
$this->load($logId);
if ($this->getId() && ($status == \Mageplaza\Smtp\Model\Source\Status::STATUS_SUCCESS)) {
$this->setStatus($status)
->save();
}

return $this;
}

Expand Down Expand Up @@ -178,7 +184,7 @@ public function resendEmail()
}
}

$this->_registry->register('mp_smtp_resend', true, true);
$this->_registry->register('mp_smtp_resend', $this->getId(), true);

$this->_transportBuilder->getTransport()
->sendMessage();
Expand Down

0 comments on commit 74f8861

Please sign in to comment.