Skip to content

Instantly share code, notes, and snippets.

@dancameron
Created December 11, 2014 18:48
Show Gist options
  • Save dancameron/c1524d3b1cfadcd43939 to your computer and use it in GitHub Desktop.
Save dancameron/c1524d3b1cfadcd43939 to your computer and use it in GitHub Desktop.
Sending an Invoice
<?php
// Sending the invoice notification using an array of user ids
do_action( 'send_invoice', $invoice, $user_ids );
// Users are associated to the client, which is associated to
// the invoice. To get the list of associated user ids the function
// SI_Notifications_Control::get_document_recipients( $invoice ) can
// be used.
$invoice = SI_Invoice::get_instance( $invoice_id ); // $invoice_id is the post id.
$user_ids = SI_Notifications_Control::get_document_recipients( $invoice );
do_action( 'send_invoice', $invoice, $user_ids );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment