aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Email.pm
Commit message (Collapse)AuthorAgeLines
* Upgrade to using Email::Sender.Matthew Somerville2017-03-28-2/+2
| | | | | | | | | | Email::Send is long deprecated and uses submodules that no longer work correctly (e.g. Net::SMTP::TLS breaks with recent IO::Socket::SSL). We create an Email::Sender subclass to perform the same functionality and this also simplifies the email code with simpler envelope handling. Bundle Email::Sender::Transport::SMTP to include fix from https://github.com/rjbs/Email-Sender/issues/46
* Remove duplicate <> around envelope senders.Matthew Somerville2017-03-14-0/+4
|
* Use shared Template base for all templates.Matthew Somerville2016-09-20-3/+2
| | | | | | Reduce some duplicated code, and as a side effect gives HTML emails our internal html_para filter, allowing single line returns in contact form submissions.
* Add HTML email templates.Matthew Somerville2016-08-01-4/+122
| | | | | | | | | | | | | | | | | | | | | | | | 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: * <th> 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 (<th>) 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.
* Remove stringify call from template pathsDave Arter2016-06-15-1/+1
|
* [UK Councils] Send correct confirm emails for updatesDave Arter2016-06-15-5/+3
| | | | | | | | | | | | | | | | | | | | | | Some UK councils with Open311 integrations (e.g. Bromley) have a custom wording in the confirmation email sent when updates are left on reports, to make the user aware that the update is sent to the council in question. Bromley noticed that some emails were being sent without this wording, leading at least one user to contact the council directly about the report. It turns out that although the email template contains an IF clause to use the appropriate wording for Bromley (and Stevenage) reports, the incorrect template file was being used when updates were made via the Bromley cobrand. This commit solves the problem by introducing a new `Cobrand::Default::path_to_email_templates` method, which is overridden by `Cobrand::UKCouncils` to include the `templates/email/fixmystreet` path. Paths returned by this method are used as the `additional_template_paths` param when templating emails. A regression test is included. Additionally moves email templates for fixmystreet.com to a directory name reflecting their purpose, in the same way the web templates are arranged.
* Strip line end spaces in emails.Matthew Somerville2016-06-07-0/+1
|
* Stop using Text::Wrap to wrap email bodies.Matthew Somerville2016-06-07-8/+0
| | | | | | | | | | | If we don't do this, the default quoted-printable encoding will make sure the lines are physically wrapped anyway. format=flowed could be an alternative, but I think "=" acting as a quasi-hyphen is somewhat nicer than every line ending with "=20". A better solution could be quoted-printable doing soft wrapping only at word breaks, making each line be readable though end with a " =", but that didn't seem worth the effort involved.
* Use only one templating system for emails.Matthew Somerville2016-05-25-48/+63
| | | | | | | Historically, emails sent offline (alerts, questionnaires, etc) used a different templating system from those sent by the website (e.g. login emails), though the newer system was also being used for the site name and signature of offline emails.
* Refactor email handling to use Email::MIME alone.Matthew Somerville2016-03-30-42/+150
|
* Better handle replies to bounce addresses.Matthew Somerville2016-02-23-5/+30
| | | | | | | | | | Auto unsubscribe alert bounces, forward on report bounces and alert replies to support, and send through to report creator non-bounce replies to their report (for systems that ignore both the From and Reply-To headers). Also forward any totally unparsed bounce to support to possibly then adjust this bounce handling.
* Pass in EmailSend arguments as a hashref.Matthew Somerville2015-12-02-1/+1
| | | | | A fix to bb1e797; when started via a Catalyst model, e.g. send_email in FixMyStreet::App, an empty hashref is passed in.
* Move EmailSend out of Catalyst for use elsewhere.Matthew Somerville2015-12-02-0/+124
|
* Test for DMARC when sending report email.Matthew Somerville2015-08-19-0/+12