Last active
December 10, 2024 12:52
-
-
Save hedqvist/94410bf8f83d6d9e90e8f972d7facea3 to your computer and use it in GitHub Desktop.
Fortnox - Set Email Address to billing email
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 | |
/** | |
* @snippet WooCommerce -Fortnox - Set customers email to Order billing emailing | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 3.9.0 | |
*/ | |
function redlight_fortnox_order_email_to( $orderData, $order_id) { | |
$order = wc_get_order($order_id); | |
$orderData['Order']['EmailInformation']['EmailAddressTo'] = $order->get_billing_email(); | |
return $orderData; | |
} | |
add_filter('obj_fortnox_order_data', 'redlight_fortnox_order_email_to', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment