Skip to content

Instantly share code, notes, and snippets.

@mauriciogofas
Forked from dancameron/functions.php
Last active August 29, 2015 14:15
Show Gist options
  • Save mauriciogofas/7bead85b41f2d84db8a9 to your computer and use it in GitHub Desktop.
Save mauriciogofas/7bead85b41f2d84db8a9 to your computer and use it in GitHub Desktop.
<?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