Skip to content
This repository has been archived by the owner on Nov 14, 2019. It is now read-only.

Commit

Permalink
Update example.php
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Nov 8, 2015
1 parent 007a345 commit 37ea007
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion class.cws.mbh.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public function openEmlFolder($emlFolder)
}

$nbFiles = 0;
while ($file = readdir($handle)) {
while (false !== ($file = readdir($handle))) {
if ($file == '.' || $file == '..' || !self::endWith($file, '.eml')) {
continue;
}
Expand Down
29 changes: 28 additions & 1 deletion example.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Eml folder
*/
if ($cwsMbh->openEmlFolder('test') === false) {
if ($cwsMbh->openEmlFolder('emls') === false) {
$error = $cwsMbh->getError();
return;
}
Expand Down Expand Up @@ -57,4 +57,31 @@
$error = $cwsMbh->getError();
} else {
// continue with CwsMbhResult

$counter = $result->getCounter();
echo '<h2>Counter</h2>';
echo 'total : ' . $counter->getTotal() . '<br />';
echo 'fetched : ' . $counter->getFetched() . '<br />';
echo 'processed : ' . $counter->getProcessed() . '<br />';
echo 'unprocessed : ' . $counter->getUnprocessed() . '<br />';
echo 'deleted : ' . $counter->getDeleted() . '<br />';
echo 'moved : ' . $counter->getMoved() . '<br />';

$mails = $result->getMails();
echo '<h2>Mails</h2>';
foreach ($mails as $mail) {
if (!$mail instanceof CwsMbhMail) {
continue;
}
echo '<h3>' . $mail->getToken() . '</h3>';
echo 'subject : ' . $mail->getSubject() . '<br />';
echo 'type : ' . $mail->getType() . '<br />';
echo 'recipients :<br />';
foreach ($mail->getRecipients() as $recipient) {
if (!$recipient instanceof CwsMbhRecipient) {
continue;
}
echo '- ' . $recipient->getEmail() . '<br />';
}
}
}

0 comments on commit 37ea007

Please sign in to comment.