-
-
Save mauriciogofas/7bead85b41f2d84db8a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function auto_send_invoice_after_creation( $invoice_id ) { | |
$invoice = SI_Invoice::get_instance( $invoice_id ); | |
$client = $invoice->get_client(); | |
$client_users = $client->get_associated_users(); | |
if ( !empty( $client_users ) ) { | |
do_action( 'send_invoice', $invoice, $client_users ); | |
} | |
} | |
add_action( 'si_recurring_invoice_created', 'auto_send_invoice_after_creation' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment