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

HSM can not include components #128

Open
ymmooot opened this issue Jun 30, 2023 · 1 comment
Open

HSM can not include components #128

ymmooot opened this issue Jun 30, 2023 · 1 comment

Comments

@ymmooot
Copy link

ymmooot commented Jun 30, 2023

Hi, I would like to send HSM having components.
The raw json is like below.

{
  "to": "{number}",
  "from": "{channel}",
  "type": "hsm",
  "content": {
    "hsm": {
      "namespace": "{namespace},
      "templateName": "{template_name}",
      "language": {
        "code": "id"
      },
      "components": [
        {
          "type": "body",
          "parameters": [
            {
              "type": "text",
              "text": "some text here"
            },
            {
              "type": "button",
              "sub_type": "url",
              "index": 0,
              "parameters": [
                {
                  "type": "text",
                  "text": "button text"
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

However, conversation.HSM type does not seem to have a way to set the components.
How to do it?

@ymmooot
Copy link
Author

ymmooot commented Jul 4, 2023

I have created my own HSM type and used Request of messagebird.DefaultClient to send components as a workaround.
I still want the HSM containing the components to send it with conversation.SendMessage.

@ymmooot ymmooot changed the title How to send HSM having components HSM can not include components Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant