diff options
author | louise <louise> | 2009-11-23 17:25:43 +0000 |
---|---|---|
committer | louise <louise> | 2009-11-23 17:25:43 +0000 |
commit | f8af48b80c43b0f9f87db5a390a8300469ef627f (patch) | |
tree | 9ee8ced09a71b2e24f137ff03b340b0a3f5ada6f /perllib/Cobrand.pm | |
parent | 075146ee0872ee0ff9e1b1c6fb84f7f5322cb7ba (diff) |
Define which vhosts send cron emails for which cobrands
Diffstat (limited to 'perllib/Cobrand.pm')
-rw-r--r-- | perllib/Cobrand.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm index 99b46ee23..4b630a099 100644 --- a/perllib/Cobrand.pm +++ b/perllib/Cobrand.pm @@ -7,7 +7,7 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: louise@mysociety.org. WWW: http://www.mysociety.org # -# $Id: Cobrand.pm,v 1.43 2009-11-19 16:41:57 louise Exp $ +# $Id: Cobrand.pm,v 1.44 2009-11-23 17:25:43 louise Exp $ package Cobrand; use strict; @@ -148,6 +148,27 @@ sub admin_base_url { } +=item email_host COBRAND + +Return the virtual host that sends email for this cobrand + +=cut + +sub email_host { + my ($cobrand) = @_; + my $email_vhost; + if ($cobrand eq '') { + $email_vhost = mySociety::Config::get('EMAIL_VHOST'); + } else { + $email_vhost = mySociety::Config::get('EMAIL_VHOST_'. uc($cobrand)); + } + if ($email_vhost && 'http://' . $email_vhost eq mySociety::Config::get('BASE_URL')) { + return 1; + } else { + return 0; + } +} + =item contact_name COBRAND Return the contact name for the cobranded version of the site |