Skip to content

Commit

Permalink
add code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aljawaid committed Oct 18, 2022
1 parent 6cc4c44 commit 29e80a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Action/EmailTaskHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function doAction(array $data)
$user = $this->userModel->getById($data['task']['owner_id']);

if (! empty($user['email'])) {
// Send email
$this->emailClient->send(
$user['email'],
$user['name'] ?: $user['username'],
Expand All @@ -68,6 +69,7 @@ public function doAction(array $data)
'editable' => false,
))
);
// Add comment to task to show an email has been fired
$this->commentModel->create( array(
'comment' => t('Task history emailed to "%s" with subject "%s".', $values['email'], $values['subject']),
'user_id' => $user,
Expand All @@ -80,6 +82,7 @@ public function doAction(array $data)
$user = $this->userModel->getById($data['task']['creator_id']);

if (! empty($user['email'])) {
// Send email
$this->emailClient->send(
$user['email'],
$user['name'] ?: $user['username'],
Expand All @@ -91,6 +94,7 @@ public function doAction(array $data)
'editable' => false,
))
);
// Add comment to task to show an email has been fired
$this->commentModel->create( array(
'comment' => t('Task history emailed to "%s" with subject "%s".', $values['email'], $values['subject']),
'user_id' => $user,
Expand Down

0 comments on commit 29e80a3

Please sign in to comment.