debug(template): expose Meta error subcode/details, add canal meta
- WhatsAppService::makeRequest: include error_subcode and error_data.details in the thrown exception message to surface the real reason for #100 errors - chat_send_message: log template name/lang/params before sending; pass canal+operator_id meta so outgoing templates are tagged correctly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f60df038d8
commit
a8380ddc81
@@ -35,7 +35,10 @@ try {
|
||||
$wa = new WhatsAppService('turnero');
|
||||
|
||||
if ($type === 'template') {
|
||||
$response = $wa->sendTemplateMessage($user['phone_number'], $template, $lang, $params);
|
||||
error_log("chat_send_message template: name={$template} lang={$lang} params=" . json_encode($params));
|
||||
$meta = ['canal' => 'turnero'];
|
||||
if ($operatorId) $meta['operator_id'] = $operatorId;
|
||||
$response = $wa->sendTemplateMessage($user['phone_number'], $template, $lang, $params, [], null, $meta);
|
||||
} else {
|
||||
$extra = ['canal' => 'turnero'];
|
||||
if ($operatorId) $extra['operator_id'] = $operatorId;
|
||||
|
||||
Reference in New Issue
Block a user