diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-02 17:18:18 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-02 17:18:18 +0100 |
commit | 35fb71de06b30927c85bee5f542f8a1480b7d090 (patch) | |
tree | 0fcff096a18db3658c8ebdca4420942f1ce6807e /perllib/FixMyStreet/App.pm | |
parent | 7cb4041271fc211f191b7436d8c5ad8474b888bf (diff) |
Put cobrand confirm/submit emails in templates, not locale, adjust email handling to cope with multiple languages for a cobrand, add Email::MIME (though unused at present), and start send-reports working.
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 1d584accb..752263d10 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -278,8 +278,10 @@ sub send_email { from => FixMyStreet->config('CONTACT_EMAIL'), %{ $c->stash }, %$extra_stash_values, - additional_template_paths => - [ $c->cobrand->path_to_email_templates->stringify ] + additional_template_paths => [ + FixMyStreet->path_to( 'templates', 'email', $c->cobrand->moniker, $c->stash->{lang_code} )->stringify, + FixMyStreet->path_to( 'templates', 'email', $c->cobrand->moniker )->stringify, + ] }; # render the template @@ -292,12 +294,13 @@ sub send_email { # pass the email into mySociety::Email to construct the on the wire 7bit # format - this should probably happen in the transport instead but hohum. - my $email_text = mySociety::Email::construct_email( + my $email_text = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email( { - _unwrapped_body_ => $email->body, # will get line wrapped + _template_ => $email->body, # will get line wrapped + _parameters_ => {}, $email->header_pairs } - ); + ) }; # send the email $c->model('EmailSend')->send($email_text); |