How To Access Notification Options For Customers On The Order Page

I need to access the whether the notification for customer was selected or not when there is a change in order_status in one of the addons I am writing.

Can some one guide me how to get that value in my addon ? I tried adding the code below but it doesnt work

if (!is_array($force_notification)) {
        $force_notification = fn_get_notification_rules($force_notification, !$force_notification);
    }
    $order_statuses = fn_get_statuses(STATUSES_ORDER, array(), true, false, ($order_info['lang_code'] ? $order_info['lang_code'] : CART_LANGUAGE), $order_info['company_id']);
    $status_params = $order_statuses[$order_info['status']]['params'];
	 $notify_user = isset($force_notification['C']) ? $force_notification['C'] : (!empty($status_params['notify']) && $status_params['notify'] == 'Y' ? true : false);
	 $notify_vendor = isset($force_notification['V']) ? $force_notification['V'] : (!empty($status_params['notify_vendor']) && $status_params['notify_vendor'] == 'Y' ? true : false);
	 if ($notify_user == true  || $notify_vendor == true) {
     // my addon code here

}

What hook do you use? Please make sure that the $force_notification variable is used by this hook

We are using the hook

fn_send_sms_change_order_status($status_to, $status_from, $order_info, $force_notification = '', $order_statuses = '', $place_order = '')

what we want to do is send an sms to the user if the notification option is Select for Customer on the Order Details Page on backend.

If the option is deselected then dont send the sms to user but perform the change status operation.

Please guide.

You can debug the content of this array with the following code if ajax is used

fn_set_notification('E', 'test', var_export($force_notification, true));

You're forcing "force_notification" to the empty string in the parameters of your hook function.

You want to send SMS if no customer notification but don't if there is?

Note that 'force_notification' is about 'forcing the notification' to a value not part of the settings. So you'd need to check both that variable and the settings value for the order_status (for the old style email templates) and for the new I can't help you, (you're on your own).

ok i found it how to do it , thanks anyways