Email sent in asynchronous mode (established the base for an application internal CRON, task queue, etc.) with adjustable configuration (disable by default). Also improved the OQL: IS_NULL() and REGEXP have been added.

SVN:trunk[1132]
This commit is contained in:
Romain Quetiez
2011-03-18 11:15:09 +00:00
parent 7989cf622f
commit b8b20f82d7
13 changed files with 840 additions and 557 deletions

View File

@@ -158,18 +158,25 @@ function DisplayStep2(SetupWebPage $oP, $sFrom, $sTo)
$oEmail->SetRecipientFrom($sFrom);
$oEmail->SetSubject("Test iTop");
$oEmail->SetBody("<p>Hello,</p><p>The email function is now working fine.</p><p>You may now be able to use the notification function.</p><p>iTop</p>");
$aIssues = $oEmail->send();
if (count($aIssues) > 0)
$iRes = $oEmail->Send($aIssues, true /* force synchronous exec */);
switch ($iRes)
{
foreach ($aIssues as $sError)
{
$oP->error($sError);
}
$oP->add("<button onClick=\"window.history.back();\"><< Back</button>\n");
}
else
{
$oP->ok("The email has been sent, you may now check that the email will arrive...");
case EMAIL_SEND_OK:
$oP->ok("The email has been sent, you may now check that the email will arrive...");
break;
case EMAIL_SEND_PENDING:
$oP->ok("Email queued");
$oP->add("<button onClick=\"window.history.back();\"><< Back</button>\n");
break;
case EMAIL_SEND_ERROR:
foreach ($aIssues as $sError)
{
$oP->error($sError);
}
$oP->add("<button onClick=\"window.history.back();\"><< Back</button>\n");
break;
}
}