diff options
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 2ae90c2fa..8e6766f58 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -292,6 +292,27 @@ sub send_email { return $email; } +=head2 uri_for_email + + $uri = $c->uri_for_email( ... ); + +Like C<uri_for> except that it checks the cobrand for an email specific url base +and uses that. + +=cut + +sub uri_for_email { + my $c = shift; + my @args = @_; + + my $normal_uri = $c->uri_for(@_); + my $base = $c->cobrand->base_url_for_emails(); + + my $email_uri = $base . $normal_uri->path_query; + + return URI->new($email_uri); +} + =head1 SEE ALSO L<FixMyStreet::App::Controller::Root>, L<Catalyst> |