mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Merge pull request #35 from jeffreyguo/pulls/test-mailer-update
Get the latest email from the email
This commit is contained in:
commit
68524346c6
@ -80,7 +80,10 @@ class TestMailer extends \Mailer {
|
||||
*/
|
||||
public function findEmail($to = null, $from = null, $subject = null, $content = null) {
|
||||
$matches = $this->findEmails($to, $from, $subject, $content);
|
||||
return $matches ? $matches[0] : null;
|
||||
//got the count of matches emails
|
||||
$emailCount = count($matches);
|
||||
//get the last(latest) one
|
||||
return $matches ? $matches[$emailCount-1] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user