X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FConf.pm;h=239e304ddf2af9a0a2be324c5fbda0fd561cd6c9;hp=f9a1696721535feeb4d1276bc8bde141bd806a5d;hb=2e4fa975e054554beac71883436b143267d7aa12;hpb=f4b7701c4c1e574ebe29e05db694d131d2799b35 diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index f9a169672..239e304dd 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1233,9 +1233,24 @@ sub reason_type_options { { 'key' => 'invoice_from', 'section' => 'required', - 'description' => 'Return address on email invoices', + 'description' => 'Return address on email invoices (address only, see invoice_from_name)', 'type' => 'text', 'per_agent' => 1, + 'validate' => sub { $_[0] =~ + /^[^@]+\@[[:alnum:]-]+(\.[[:alnum:]-]+)+$/ + ? '' : 'Invalid email address'; + } + }, + + { + 'key' => 'invoice_from_name', + 'section' => 'invoicing', + 'description' => 'Return name on email invoices (set address in invoice_from)', + 'type' => 'text', + 'per_agent' => 1, + 'validate' => sub { (($_[0] =~ /[^[:alnum:][:space:]]/) && ($_[0] !~ /^\".*\"$/)) + ? 'Invalid name. Use quotation marks around names that contain punctuation.' + : '' } }, {