Use AlexaCRM Api to Create record on Order Completion
-
Hi Team,
Another Question – generally about calling the AlexaCRM api in php code (i am using the dataverse integration and have this plug in enabled). Are there any good examples here? I have been trying to code from this tutorial but with no luck
https://github.com/AlexaCRM/dynamics-webapi-toolkit/wiki/Tutorial
This example i want to run the php function – call_order_status_completed when an order to complete and create a contact. I know the action works just not the code i have for Alexacrm integration
// define woocommerce_order_status_completed callback function
function call_order_status_completed( $array ) {$contact = new \AlexaCRM\Xrm\Entity( ‘contact’ );
$contact[‘firstname’] = ‘Nancy’;
$contact[‘lastname’] = ‘Anderson’;
$contact[’emailaddress1′] = ‘[email protected]’;$contactId = $client->Create( $contact );
};
// Call our custom function with the action hook
add_action( ‘woocommerce_order_status_completed’, ‘call_order_status_completed’, 10, 1);
- The topic ‘Use AlexaCRM Api to Create record on Order Completion’ is closed to new replies.