aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/EmailSend
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-02-02 17:47:18 +0000
committerMatthew Somerville <matthew@mysociety.org>2016-02-23 13:11:37 +0000
commit28144f5153a0a7f7bad9466c883bd5c147568028 (patch)
treeed205b75e336fa53d4f622451d3209cfcae31915 /perllib/FixMyStreet/EmailSend
parent06b8a48093a0ce395ea6824e6b00afec444447c3 (diff)
Better handle replies to bounce addresses.
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.
Diffstat (limited to 'perllib/FixMyStreet/EmailSend')
-rw-r--r--perllib/FixMyStreet/EmailSend/ContactEmail.pm9
-rw-r--r--perllib/FixMyStreet/EmailSend/DoNotReply.pm9
-rw-r--r--perllib/FixMyStreet/EmailSend/Variable.pm17
3 files changed, 17 insertions, 18 deletions
diff --git a/perllib/FixMyStreet/EmailSend/ContactEmail.pm b/perllib/FixMyStreet/EmailSend/ContactEmail.pm
deleted file mode 100644
index 28bcc983b..000000000
--- a/perllib/FixMyStreet/EmailSend/ContactEmail.pm
+++ /dev/null
@@ -1,9 +0,0 @@
-package FixMyStreet::EmailSend::ContactEmail;
-use base Email::Send::SMTP;
-
-sub get_env_sender {
- my $sender = FixMyStreet->config('CONTACT_EMAIL');
- return $sender;
-}
-
-1;
diff --git a/perllib/FixMyStreet/EmailSend/DoNotReply.pm b/perllib/FixMyStreet/EmailSend/DoNotReply.pm
deleted file mode 100644
index d1368f00f..000000000
--- a/perllib/FixMyStreet/EmailSend/DoNotReply.pm
+++ /dev/null
@@ -1,9 +0,0 @@
-package FixMyStreet::EmailSend::DoNotReply;
-use base Email::Send::SMTP;
-
-sub get_env_sender {
- my $sender = FixMyStreet->config('DO_NOT_REPLY_EMAIL');
- return $sender;
-}
-
-1;
diff --git a/perllib/FixMyStreet/EmailSend/Variable.pm b/perllib/FixMyStreet/EmailSend/Variable.pm
new file mode 100644
index 000000000..4ba56dd41
--- /dev/null
+++ b/perllib/FixMyStreet/EmailSend/Variable.pm
@@ -0,0 +1,17 @@
+package FixMyStreet::EmailSend::Variable;
+use base Email::Send::SMTP;
+use FixMyStreet;
+
+my $sender;
+
+sub send {
+ my ($class, $message, %args) = @_;
+ $sender = delete($args{env_from}) || FixMyStreet->config('DO_NOT_REPLY_EMAIL');
+ $class->SUPER::send($message, %args);
+}
+
+sub get_env_sender {
+ $sender;
+}
+
+1;