Skip to content

Commit

Permalink
added the option to email a candidate from the candidate show page (i…
Browse files Browse the repository at this point in the history
…t was already implemented through mailto:, but this option is through OpenCATS so the email templates can be used) (#246)
  • Loading branch information
skrchnavy authored and RussH committed Oct 1, 2019
1 parent 76c3041 commit b26e10e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
28 changes: 19 additions & 9 deletions modules/candidates/CandidatesUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -3332,21 +3332,31 @@ private function onEmailCandidates()
}
else
{
$dataGrid = DataGrid::getFromRequest();

$candidateIDs = $dataGrid->getExportIDs();

/* Validate each ID */
foreach ($candidateIDs as $index => $candidateID)
if(isset($_GET['candidateID']))
{
if (!$this->isRequiredIDValid($index, $candidateIDs))
{
if (!$this->isRequiredIDValid('candidateID', $_GET)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
return;
}
$candidateID = $_GET['candidateID'];
$db_str = $candidateID;
}
else
{
$dataGrid = DataGrid::getFromRequest();

$candidateIDs = $dataGrid->getExportIDs();

/* Validate each ID */
foreach ($candidateIDs as $index => $candidateID) {
if (!$this->isRequiredIDValid($index, $candidateIDs)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
return;
}
}

$db_str = implode(", ", $candidateIDs);
$db_str = implode(", ", $candidateIDs);
}

$db = DatabaseConnection::getInstance();

Expand Down
13 changes: 10 additions & 3 deletions modules/candidates/Show.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,16 @@ use OpenCATS\UI\CandidateDuplicateQuickActionMenu;
<tr>
<td class="vertical">E-Mail:</td>
<td class="data">
<a href="mailto:<?php $this->_($this->data['email1']); ?>">
<?php $this->_($this->data['email1']); ?>
</a>
<?php if ($this->data['email1'] != ""): ?>
<a href="mailto:<?php $this->_($this->data['email1']); ?>" title="Send E-Mail via Email Client">
<?php $this->_($this->data['email1']); ?>
</a>
<a href="index.php?m=candidates&amp;a=emailCandidates&candidateID=<?php echo $this->_($this->data['candidateID']); ?>" title="Send E-Mail via OpenCATS"/>
<img src="images/actions/email.gif" width="16" height="16" alt="" class="absmiddle" border="0" />
</a>
<?php else: ?>
<img src="images/actions/email_no.gif" title="No E-Mail Address" width="16" height="16" alt="" class="absmiddle" border="0" />
<?php endif; ?>
</td>
</tr>
<tr>
Expand Down

2 comments on commit b26e10e

@RussH
Copy link
Member

@RussH RussH commented on b26e10e Oct 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shantadam the intention here is so that the email templates can be used to send emails with templates to candidates rather than bailing out to your email client using a mailto: link

@RussH
Copy link
Member

@RussH RussH commented on b26e10e Oct 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would also allow us to record the email in the candidate activity log.

Please sign in to comment.