From 1820db45188fd62699223f63167c5f7250d1b7a6 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 15 Jul 2016 18:31:52 +0100 Subject: Add HTML email templates. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Design is all Zarino. This adds the ability to send HTML emails, including attached inline images. When included, this is done as a multipart/related email containing a multipart/alternative (of plain and HTML) and any attached images, so that the images are available even if HTML mail is not. The alert emails list data has been improved so it can be constructed in the templates rather than the code. Various templates have been tidied. Various workarounds for email clients have been made, including: * is used so that the Android 4.x mail client can give them `block` styling in the small screen media query. * Font settings defined on every table cell () so that sans-serif fonts are used in Outlook, rather than Times New Roman. * A three-column wrapper table to create a 620px centred content area that also shrinks down on narrow screens. (Outlook doesn’t like max-width, so this is the simplest alternative.) * Enforcing a sensible (500px) min-width for the main content area, on clients that don’t support media queries (eg: native Gmail app). * Giant borders on buttons so Outlook displays them * Image alignment with align rather than float. --- perllib/FixMyStreet/App/Controller/Contact.pm | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller/Contact.pm') diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm index e20011471..5527256a6 100644 --- a/perllib/FixMyStreet/App/Controller/Contact.pm +++ b/perllib/FixMyStreet/App/Controller/Contact.pm @@ -168,26 +168,22 @@ sub prepare_params_for_email : Private { if ( $c->stash->{update} ) { - my $problem_url = $base_url . '/report/' . $c->stash->{update}->problem_id + $c->stash->{problem_url} = $base_url . '/report/' . $c->stash->{update}->problem_id . '#update_' . $c->stash->{update}->id; - my $admin_url = " - $admin_url" . '/update_edit/' . $c->stash->{update}->id - if $admin_url; - $c->stash->{message} .= sprintf( - " \n\n[ Complaint about update %d on report %d - %s%s ]", + $c->stash->{admin_url} = $admin_url . '/update_edit/' . $c->stash->{update}->id; + $c->stash->{complaint} = sprintf( + "Complaint about update %d on report %d", $c->stash->{update}->id, $c->stash->{update}->problem_id, - $problem_url, $admin_url ); } elsif ( $c->stash->{problem} ) { - my $problem_url = $base_url . '/report/' . $c->stash->{problem}->id; - $admin_url = " - $admin_url" . '/report_edit/' . $c->stash->{problem}->id - if $admin_url; - $c->stash->{message} .= sprintf( - " \n\n[ Complaint about report %d - %s%s ]", + $c->stash->{problem_url} = $base_url . '/report/' . $c->stash->{problem}->id; + $c->stash->{admin_url} = $admin_url . '/report_edit/' . $c->stash->{problem}->id; + $c->stash->{complaint} = sprintf( + "Complaint about report %d", $c->stash->{problem}->id, - $problem_url, $admin_url ); # flag this so it's automatically listed in the admin interface -- cgit v1.2.3