Mike,
> > This is what we do in our internal workflow class, method handleNewEmail():
> >
>
> > if (!in_array($sender_email, $staff_emails)) {
>
> Where are you getting $sender_email from?
>
Oops, sorry. Here it is:
$sender_email =
strtolower(Mail_API::getEmailAddress($message->headers['from']));
That should work.
> > $this->markAsWaitingOnDeveloper($issue_id, $status_id,
> > 'email');
>
> Could you send me your markAsWaitingOnDeveloper function please?
>
Oh, didn't see that. markAsWaitingOnDeveloper() is just a fancy wrapper on top
of Issue::setStatus():
function markAsWaitingOnDeveloper($issue_id, $status_id, $type)
{
Issue::setStatus($issue_id, $status_id);
// save a history entry about this...
if ($type == 'email') {
$desc = "Issue automatically set to status '" .
Status::getStatusTitle($status_id) . "' because of a non-staff incoming email.";
} elseif ($type == 'file') {
$desc = "Issue automatically set to status '" .
Status::getStatusTitle($status_id) . "' because a new file was uploaded by a
customer.";
} elseif ($type == 'update') {
$desc = "Issue automatically set to status '" .
Status::getStatusTitle($status_id) . "' because the issue was updated by a
customer contact.";
} elseif ($type == 'blocked_email') {
$desc = "Issue automatically set to status '" .
Status::getStatusTitle($status_id) . "' because of a blocked incoming email.";
} elseif ($type == 'note') {
$desc = "Issue automatically set to status '" .
Status::getStatusTitle($status_id) . "' because of a new internal note was
posted.";
}
History::add($issue_id, APP_SYSTEM_USER_ID,
History::getTypeID('status_auto_changed'), $desc);
}
--Joao