X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fmagicmail.pm;h=ba76609ce9b2955edc5bb39041ad64a434bfad54;hb=cc4caa54e9974ea3d6ac7cf55cf45863d2a8905e;hp=c2be9bc0580c30256e4787ec5ba12892afafd549;hpb=3784fb15b8d54aeb37e2f39bf87f61b513ba41c3;p=freeside.git diff --git a/FS/FS/part_export/magicmail.pm b/FS/FS/part_export/magicmail.pm index c2be9bc05..ba76609ce 100644 --- a/FS/FS/part_export/magicmail.pm +++ b/FS/FS/part_export/magicmail.pm @@ -53,20 +53,22 @@ L. Use L to retrieve this message. use vars qw( %info ); tie my %options, 'Tie::IxHash', - 'client_id' => { label => 'API Client ID', - default => '' }, - 'client_password' => { label => 'API Client Password', - default => '' }, - 'account_prefix' => { label => 'Account Prefix', - default => 'FREESIDE' }, - 'package' => { label => 'Package', - default => 'EMAIL' }, - 'port' => { label => 'Port', - default => 443 }, - 'autopurge' => { type => 'checkbox', - label => 'Auto purge user/account on unprovision' }, - 'debug' => { type => 'checkbox', - label => 'Enable debug warnings' }, + 'client_id' => { label => 'API Client ID', + default => '' }, + 'client_password' => { label => 'API Client Password', + default => '' }, + 'account_prefix' => { label => 'Account Prefix', + default => 'FREESIDE' }, + 'package' => { label => 'Package', + default => 'EMAIL' }, + 'port' => { label => 'Port', + default => 443 }, + 'autopurge' => { type => 'checkbox', + label => 'Auto purge user/account on unprovision' }, + 'use_agent_custid' => { type => 'checkbox', + label => 'Use agent_custid for Magicmail account_id when available' }, + 'debug' => { type => 'checkbox', + label => 'Enable debug warnings' }, ; %info = ( @@ -397,7 +399,11 @@ Returns MagicMail account_id for this customer under this export. sub cust_account_id { my ($self, $in) = @_; my $cust_main = ref($in) eq 'FS::cust_main' ? $in : $in->cust_main; - return $self->option('account_prefix') . $cust_main->custnum; + return $self->option('account_prefix'). + ( ($self->option('use_agent_custid') && $cust_main->agent_custid) + ? $cust_main->agent_custid + : $cust_main->custnum + ); } =head2 cust_magic_services @@ -1285,14 +1291,6 @@ L Jonathan Prykop jonathan@freeside.biz -=head1 LICENSE AND COPYRIGHT - -Copyright 2015 Freeside Internet Services - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation. - =cut 1;