Code Monkey home page Code Monkey logo

Comments (4)

ker0x avatar ker0x commented on July 28, 2024 1

@yaliniyalu this is has been fixed in 3.0. You can do like this

$ge = GenericElement::create('title');
$ge->setSubtitle('subtitle');
$message = GenericTemplate::create([$ge]);
$messenger->send()->message('1973204866024629', $message, [
    'notification_type' => Send::NOTIFICATION_TYPE_REGULAR, 
    'tag' => Send::TAG_ISSUE_RESOLUTION,
]);

from messenger.

ker0x avatar ker0x commented on July 28, 2024

Hello,

according to the doc, all tags, except NON_PROMOTIONAL_SUBSCRIPTION, can only be used with generic model! Are you using another model ? If so, can you try with the GenericTemplate and keep me updated ?

Anyway, I have to add a check on the tags !

from messenger.

yaliniyalu avatar yaliniyalu commented on July 28, 2024

I tried this
$ge = GenericElement::create('title');
$ge->setSubtitle('subtitle');
$message = GenericTemplate::create([$ge->toArray()]);
$messenger->send()->message('1973204866024629', $message, Send::NOTIFICATION_TYPE_REGULAR, Send::TAG_ISSUE_RESOLUTION);

$request->build() in send.php gives
{
"headers": {
"Content-Type": "application/json"
},
"json": {
"messaging_type": "RESPONSE",
"recipient": {
"id": "1973204866024629"
},
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "title",
"subtitle": "subtitle"
}
]
}
}
},
"notification_type": "REGULAR",
"tag": "ISSUE_RESOLUTION"
},
"query": {
"access_token": ""
}
}

from messenger.

ker0x avatar ker0x commented on July 28, 2024

Ok, forget what i say, i d'ont allow to change the value of messagingType in message() 👎

I will fixed that in the coming day

from messenger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.