diff --git a/Whatsapp Message/form.json b/Whatsapp Message/form.json index 057d85e..8588e08 100644 --- a/Whatsapp Message/form.json +++ b/Whatsapp Message/form.json @@ -4,49 +4,8 @@ { "type": "ValidationTextBox", "name": "WbToken", "caption": "Token" }, { "type": "ValidationTextBox", "name": "WbAppId", "caption": "App ID"}, { "type": "ValidationTextBox", "name": "WbTemplate", "caption": "Templatename"}, - { "type": "ValidationTextBox", "name": "WbLang", "caption": "Language Code (de NICHT de_DE)"}, - { - "type": "List", - "name": "Parameterlist", - "caption": "Parameter List", - "rowCount": 3, - "add": true, - "delete": true, - "sort": { - "column": "ParNumber", - "direction": "ascending" - }, - "columns": [ - { - "caption": "Parameter Number", - "name": "ParNumber", - "width": "auto", - "add": "0" - }, - { - "caption": "Parameter Alias", - "name": "ParAlias", - "width": "auto", - "add": "", - "edit": { - "type": "ValidationTextBox" - } - }, - { - "caption": "Parametername", - "name": "ParName", - "width": "auto", - "add": "", - "edit": { - "type": "ValidationTextBox" - } - } - ], - "values": [{ - "ParAlias": "New Parameter", - "ParName": "pn" - }] - } + { "type": "ValidationTextBox", "name": "WbLang", "caption": "Language Code (de NICHT de_DE)"} + ], "actions": diff --git a/Whatsapp Message/module.php b/Whatsapp Message/module.php index a372304..43946da 100644 --- a/Whatsapp Message/module.php +++ b/Whatsapp Message/module.php @@ -36,11 +36,8 @@ class WhatsappMessage extends IPSModule { $paramarr= json_decode($arrString, true); $parameters = []; - - for ($i = 0; $i < count($paramarr); $i++) { - $paramName = $paramarr[$i]['ParName']; - $paramValue = isset($paramvals[$i]) ? $paramvals[$i] : ''; - + + foreach ($paramvals as $paramName => $paramValue) { $parameters[] = [ "type" => "text", "parameter_name" => $paramName, @@ -49,7 +46,7 @@ class WhatsappMessage extends IPSModule { } print_r($parameters); - + $data = [ "messaging_product" => "whatsapp", "to" => $recip,