diff options
Diffstat (limited to 'FS/FS/Conf.pm')
-rw-r--r-- | FS/FS/Conf.pm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 39f12c25a..279a4dfe8 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.' + : '' } }, { |