diff options
-rw-r--r-- | perllib/FixMyStreet/App.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/View/Email.pm | 2 | ||||
-rw-r--r-- | t/app/helpers/send_email.t | 4 | ||||
-rw-r--r-- | templates/email/default/login.txt (renamed from templates/email/default/login) | 0 | ||||
-rw-r--r-- | templates/email/default/test.txt (renamed from templates/email/default/test) | 0 |
6 files changed, 5 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 18e79e6b7..d73e721bf 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -160,7 +160,7 @@ sub setup_cobrand { =head2 send_email - $email_sent = $c->send_email( 'email_template', $extra_stash_values ); + $email_sent = $c->send_email( 'email_template.txt', $extra_stash_values ); Send an email by filling in the given template with values in the stash. diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm index 912119cd3..3d60172cf 100644 --- a/perllib/FixMyStreet/App/Controller/Auth.pm +++ b/perllib/FixMyStreet/App/Controller/Auth.pm @@ -104,7 +104,7 @@ sub email_login : Private { # log the user in, send them an email and redirect to the welcome page $c->stash->{token} = $token_obj->token; - $c->send_email( 'login', { to => $good_email } ); + $c->send_email( 'login.txt', { to => $good_email } ); $c->res->redirect( $c->uri_for('token') ); } diff --git a/perllib/FixMyStreet/App/View/Email.pm b/perllib/FixMyStreet/App/View/Email.pm index fa46623eb..86d5c1d60 100644 --- a/perllib/FixMyStreet/App/View/Email.pm +++ b/perllib/FixMyStreet/App/View/Email.pm @@ -8,7 +8,7 @@ use mySociety::Locale; use FixMyStreet; __PACKAGE__->config( - TEMPLATE_EXTENSION => '.html', + TEMPLATE_EXTENSION => '.txt', INCLUDE_PATH => [ # FixMyStreet->path_to( 'templates', 'email', 'default' ), ], diff --git a/t/app/helpers/send_email.t b/t/app/helpers/send_email.t index 16e85b4ce..adf2c56c1 100644 --- a/t/app/helpers/send_email.t +++ b/t/app/helpers/send_email.t @@ -28,7 +28,8 @@ $c->stash->{foo} = 'bar'; Email::Send::Test->clear; # send the test email -ok $c->send_email( 'test', { to => 'test@recipient.com' } ), "sent an email"; +ok $c->send_email( 'test.txt', { to => 'test@recipient.com' } ), + "sent an email"; # check it got templated and sent correctly my @emails = Email::Send::Test->emails; @@ -38,7 +39,6 @@ is scalar(@emails), 1, "caught one email"; my $email_as_string = $emails[0]->as_string; ok $email_as_string =~ s{\s+Date:\s+\S.*?$}{}xms, "Found and stripped out date"; - is $email_as_string, file(__FILE__)->dir->file('send_email_sample.txt')->slurp, "email is as expected"; diff --git a/templates/email/default/login b/templates/email/default/login.txt index c873e82af..c873e82af 100644 --- a/templates/email/default/login +++ b/templates/email/default/login.txt diff --git a/templates/email/default/test b/templates/email/default/test.txt index 1200b8726..1200b8726 100644 --- a/templates/email/default/test +++ b/templates/email/default/test.txt |