Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format of Whatsapp MTM parameters is wrong #322

Closed
thiagolcks opened this issue Aug 11, 2022 · 1 comment · Fixed by #347
Closed

Format of Whatsapp MTM parameters is wrong #322

thiagolcks opened this issue Aug 11, 2022 · 1 comment · Fixed by #347
Assignees
Labels
bug release-candidate This PR will result in a release

Comments

@thiagolcks
Copy link
Contributor

When trying to send a Whatsapp MTM with parameters, it returns: "Invalid paramsThe value of one or more parameters is invalid."

Expected Behavior

The message should be sent.

Current Behavior

An exception is being thrown.

Possible Solution

The way that the parameters are being added to the $returnArray in the class TemplateObject is wrong. The parameters are wrapped in an extra array.

Currently:

"template": {
    "name": "namespace:name",
    "0": {
      "parameters": ["ABC"]
     }
}

Should be:

"template": {
    "name": "namespace:name",
    "parameters": ["ABC"]
}

Steps to Reproduce (for bugs)

Just try to send any message with any parameters:

$template = new TemplateObject('namespace:name', ['ABC']);
$whatsAppText = new WhatsAppTemplate($to, $from, $template, 'pt-BR');
$client->messages()->send($whatsAppText);

Your Environment

  • Version used: 3.1.0
  • Environment name and version: PHP 8.1
@thiagolcks thiagolcks changed the title Format of Whatsapp is wrong Format of Whatsapp MTM parameters is wrong Aug 11, 2022
thiagolcks added a commit to thiagolcks/vonage-php-sdk-core that referenced this issue Aug 11, 2022
@SecondeJK SecondeJK self-assigned this Aug 16, 2022
@SecondeJK SecondeJK added bug release-candidate This PR will result in a release labels Aug 16, 2022
@SecondeJK
Copy link
Contributor

Fixed by #323 , thank you for your contribution!

bearer-pipeline-test pushed a commit to BearerPipelineTest/vonage-php-sdk-core that referenced this issue Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug release-candidate This PR will result in a release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants