sub email { my ($self, $data) = @_; $data->{InvoiceNumber} = $self->{InvoiceNumber}; for (qw/FromEmail FromName SubjectLine Body RecipientEmail/) { die "You must supply the $_ parameter" unless $data->{$_}; } $self->{kf}->_c("EmailInvoice", $data); } #### my_user my_pass Billing billing@billing.co.uk ghenry@ghenry.co.uk Many thanks for your business! Please see attached invoice. -- Kind Regards, Billing. E billing@billing.co.uk http://www.billing.co.uk 239925 Invoice from billing for February 2015 #### EmailInvoice => { endpoint => 'https://securedwebapp.com/api/service.asmx', soapaction => 'KashFlow/EmailInvoice', namespace => 'KashFlow', parameters => [ SOAP::Data->new(name => 'UserName', type => 'xsd:string', attr => {}), SOAP::Data->new(name => 'Password', type => 'xsd:string', attr => {}), SOAP::Data->new(name => 'InvoiceNumber', type => 'xsd:int', attr => {}), SOAP::Data->new(name => 'FromEmail', type => 'xsd:string', attr => {}), SOAP::Data->new(name => 'FromName', type => 'xsd:string', attr => {}), SOAP::Data->new(name => 'SubjectLine', type => 'xsd:string', attr => {}), SOAP::Data->new(name => 'Body', type => 'xsd:string', attr => {}), SOAP::Data->new(name => 'RecipientEmail', type => 'xsd:string', attr => {}), ], # end parameters }, # end EmailInvoice #### sub _c { my ($self, $method, @args) = @_; my ($result, $status, $explanation) = KashFlowAPI->$method($self->{username}, $self->{password}, @args); if ($explanation) { croak($explanation) } return $result; } #### $VAR1 = { 'FromName' => 'Billing', 'FromEmail' => 'billing@billing.co.uk', 'RecipientEmail' => 'ghenry@ghenry.co.uk', 'Body' => 'Many thanks for your business! Please see attached invoice. -- Kind Regards, Billing. E billing@billing.co.uk http://www.billing.co.uk', 'InvoiceNumber' => '239925', 'SubjectLine' => 'Invoice from Billing for February 2015' };