mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
get the last one email
This commit is contained in:
parent
7b85ffdcde
commit
4f7b794d9c
@ -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