Skip to content

Commit

Permalink
allow sending invoice to a custom email
Browse files Browse the repository at this point in the history
  • Loading branch information
javorosas committed Oct 4, 2019
1 parent 73179ca commit 0c21574
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Resources/Invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ public function cancel( $id ) {
*
* @throws Facturapi_Exception
**/
public function send_by_email( $id ) {
public function send_by_email( $id, $email = null ) {
try {
return json_decode( $this->execute_post_request( $this->get_request_url( $id ) . "/email", null ) );
return json_decode( $this->execute_JSON_post_request(
$this->get_request_url($id) . "/email",
array("email" => $email)
));
} catch ( Facturapi_Exception $e ) {
throw new Facturapi_Exception( 'Unable to send Invoice: ' . $e );
}
Expand Down

0 comments on commit 0c21574

Please sign in to comment.