diff options
author | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-03-23 17:37:05 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-03-23 17:37:05 +0000 |
commit | 197d916501696c1d8811f05f1ef23e2a11d6e1b4 (patch) | |
tree | 931ff98a8202d537393362f36660ff08f1fd432c /perllib/Page.pm | |
parent | f10475c5f5a8f7e6a24579c4575c5bb208cc0428 (diff) | |
parent | 9e3f0cc26dbbd0e1b3d9d4aaf89fffec41557027 (diff) |
Merge branch 'master' of ssh://matthew@git.mysociety.org/data/git/public/fixmystreet
Diffstat (limited to 'perllib/Page.pm')
-rw-r--r-- | perllib/Page.pm | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm index 6c5af0fc5..24c52885a 100644 --- a/perllib/Page.pm +++ b/perllib/Page.pm @@ -392,12 +392,10 @@ sub error_page ($$) { } # send_email TO (NAME) TEMPLATE-NAME PARAMETERS -# TEMPLATE-NAME is currently one of problem, update, alert, tms +# TEMPLATE-NAME is a full filename here. sub send_email { - my ($q, $recipient_email_address, $name, $thing, %h) = @_; - my $file_thing = $thing; - $file_thing = 'empty property' if $q->{site} eq 'emptyhomes' && $thing eq 'problem'; # Needs to be in English - my $template = "$file_thing-confirm"; + my ($q, $recipient_email_address, $name, $template, %h) = @_; + $template = File::Slurp::read_file("$FindBin::Bin/../templates/emails/$template"); my $to = $name ? [[$recipient_email_address, $name]] : $recipient_email_address; my $cobrand = get_cobrand($q); @@ -445,6 +443,19 @@ sub send_email { ); } +} + +# send_confirmation_email TO (NAME) TEMPLATE-NAME PARAMETERS +# TEMPLATE-NAME is currently one of problem, update, alert, tms +sub send_confirmation_email { + my ($q, $recipient_email_address, $name, $thing, %h) = @_; + + my $file_thing = $thing; + $file_thing = 'empty property' if $q->{site} eq 'emptyhomes' && $thing eq 'problem'; # Needs to be in English + my $template = "$file_thing-confirm"; + + send_email($q, $recipient_email_address, $name, $template, %h); + my ($action, $worry); if ($thing eq 'problem') { $action = _('your problem will not be posted'); @@ -469,6 +480,7 @@ if you do not, %s.</p> <p>(Don't worry — %s)</p> EOF + my $cobrand = get_cobrand($q); my %vars = ( action => $action, worry => $worry, |