diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-30 14:12:13 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-30 14:12:13 +0100 |
commit | 81f86542c4d306d89f9a3718154203b35583fee5 (patch) | |
tree | c043ddd72accf65457dbbe624aad339967f9120e /perllib/FixMyStreet/TestMech.pm | |
parent | 85dd4e1058dd2a5c54951bd966a2625d23478155 (diff) | |
parent | ab8360f148d8d4026905ef8e10decee43bd16b4a (diff) |
Merge branch 'zurich-staging'
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm index 16871d0f2..927e4556c 100644 --- a/perllib/FixMyStreet/TestMech.pm +++ b/perllib/FixMyStreet/TestMech.pm @@ -229,6 +229,17 @@ sub get_email { return $emails[0]; } +sub get_email_envelope { + my $mech = shift; + my @emails = FixMyStreet::Email::Sender->default_transport->deliveries; + @emails = map { $_->{envelope} } @emails; + + return @emails if wantarray; + + $mech->email_count_is(1) || return undef; + return $emails[0]; +} + sub get_text_body_from_email { my ($mech, $email, $obj) = @_; unless ($email) { |