diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-07-03 13:48:21 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-30 12:44:57 +0100 |
commit | b9139dbd71282dd13ab68a3cef9623c4b5ba2218 (patch) | |
tree | 1014a5f93df482376abbaf1abe4c19c5d31cc221 /perllib/FixMyStreet/TestMech.pm | |
parent | 347e5b812a122f68d011ab460d6a32906afc5d4e (diff) |
[Zurich] Set envelope for external body emails.
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) { |