| Net-FreshBooks-API documentation | Contained in the Net-FreshBooks-API distribution. |
Net::FreshBooks::API::Role::SendBy - Send by email and snail mail roles
version 0.21
Roles for sending by email and snail mail. Used for both Estimates and Invoices. Please refer to these modules for specific examples of how to use these methods.
This software is copyright (c) 2011 by Edmund von der Burg & Olaf Alders.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| Net-FreshBooks-API documentation | Contained in the Net-FreshBooks-API distribution. |
use strict; use warnings; package Net::FreshBooks::API::Role::SendBy; BEGIN { $Net::FreshBooks::API::Role::SendBy::VERSION = '0.21'; } use Moose::Role; use Data::Dump qw( dump ); sub send_by_email { my $self = shift; return $self->_send_using( 'sendByEmail' ); } sub send_by_snail_mail { my $self = shift; return $self->_send_using( 'sendBySnailMail' ); } sub _send_using { my $self = shift; my $how = shift; my $method = $self->method_string( $how ); my $id_field = $self->id_field; my $res = $self->send_request( { _method => $method, $id_field => $self->$id_field, } ); # refetch the estimate so that the flags are updated. $self->get( { $id_field => $self->$id_field } ); return 1; } 1; # ABSTRACT: Send by email and snail mail roles __END__