how can send inlineKeyboard with answerInlineQuery Telegram bot - telegram-bot

I have a telegram bot with irazasyed package and set it to 'inline mode' now when user type (#botid aboutus) bot show text for user like below :
now i need when user click to that item, bot send inlineKeyboard to user like below :

Solved!
$results= json_encode( [
[
'type' => "article",
'id'=> "1",
'title'=> "chek inline keybord ",
'description'=> "test ",
'caption'=> "caption" ,
'input_message_content'=> ['message_text' => "you can share inline keyboard to other chat"],
'reply_markup'=>['inline_keyboard'=>[
[
['text'=>"text1",'url'=>''],
['text'=>"text2",'url'=>''],
['text'=>"shareToOtherChat",'switch_inline_query'=>'chek']
]
]],
'thumb_url'=> "https://avatars2.githubusercontent.com/u/10547598?v=3&s=88",
]
] );

Related

LinkedIn Campagin API Link not inserted

I am using the marketing API to create ads with curl in PHP.
Creating Campaign Groups and Campaigns in this way is working perfectly fine. The basic creation of a creative and an ad is also working. The only problem is that i can’t add a destination URL and some other info’s like the description and Call-to-Action. But the destination URL or content Landing Page like it’s called in the documentation really is fundamental.
This is my code for the creative data:
$data = [
"creative" => [
"inlineContent" => [
"post" => [
"adContext" => [
"dscAdAccount" => "urn:li:sponsoredAccount:".$this->params->get('app.linkedin_my_acc_id'),
"dscStatus" => "ACTIVE"
],
"author" => "urn:li:organization:".$this->params->get('app.linkedin_my_org_id'),
"commentary" => $job->getCommentary(),
"visibility" => "PUBLIC",
"lifecycleState" => "PUBLISHED",
"isReshareDisabledByAuthor" => false,
"contentCallToActionLabel" => "DOWNLOAD",
"contentLandingPage" => "https://google.com",
"content" => [
"media" => [
"title" => "This is a test!",
"id" => $image
]
]
]
],
"campaign" => "urn:li:sponsoredCampaign:".$myCampaignId,
"intendedStatus" => "ACTIVE"
]
];
The structure is the same as in the documentation (https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-creatives-new?view=li-lms-2023-01&tabs=http#creatives-inline-schema).
So what am I doing wrong? Why is LinkedIn ignoring my contentLandingPage and contentCallToActionLabel values? The request is working and Im not getting an unpermitted fields error so it seems to be correct…
Can someone help? I also can provide the code of the Campaign Group and the Campaign if needed.
Not sure if this is important but the objectiveType of my Campaign is “WEBSITE_VISIT” and the type is “SPONSORED_UPDATES”.

mailjet send api no composer where to upload the php library?

I am trying to use the mailjet send API for transactional emails from my wordpress website. My mailjet account works fine and I have a contact form that works fine with the mailjet plugin. When the contact form is submitted, an email is sent using mailjet.
Now I want to use the transactional templates from mailjet to replace my actual wp_mail function used in my contact page, because the emails sent using wp_mail doesn't look nice.
I already uploaded the php library (no composer) https://github.com/mailjet/mailjet-apiv3-php-no-composer to my server to the path htdocs/. I created a template on mailjet and published it. The template has the id mentioned in the code below.
This is my code for the send api transactional contact emails.
<form action="" name="contactform" method="post">
...
</form>
<?php
if($emailisright=="OK"){
require_once("/mailjet-apiv3-php-no-composer-master/vendor/autoload.php");
use \src\Mailjet\Resources;
$apikey = '***********************';
$apisecret = '***************************';
$body = [
'Messages' => [
[
'From' => [
'Email' => "no_reply#myemail.com",
'Name' => "Contact mywebsite"
],
'To' => [
[
'Email' => "testemail#gmail.com",
'Name' => "Test email"
]
],
'TemplateID' => 4546355,
'TemplateLanguage' => true,
'Subject' => "Re : contact",
'Variables' => json_decode('{
"name": "Tester",
"mailcc": "testemail#gmail.com",
"message": "test 9"
}', true)
]
]
];
$response = $mj->post(Resources::$Email, ['body' => $body]);
$response->success() && var_dump($response->getData());
}
?>
The page got blank. But when I exclude the following line code //use \src\Mailjet\Resources; then the page renders perfectly, but when submitting the form, I get a broken page which is normal as the line code //use \src\Mailjet\Resources; has been removed. This means that use \src\Mailjet\Resources; seems to be the issue. I also tried with use \Mailjet\Resources; but same broken result.
Now I am not sure I uploaded the php library on the right place on my server. This is the full server path to the wordpress website /opt/bitnami/apps/wordpress/htdocs.
Where do I have to upload the PHP mailjet library?
And where do I have to upload my contact page? On the same level of the mailjet PHP library?

JBPM 7.31 reassign notifications

In JBPM is possible to resend a notifications after a reassign operation?
Example:
This is an example of my process
The Task Evolution is configured to send a notification to the potential owners.
If the task is not processed administrator user can reassign the task to a new group.
Here is an example of the notification configuration
My goal is that the notifications is sent to the new group.
How can I do?
You can create new notification using kie-server REST API:
POST /server/admin/containers/{containerId}/tasks/{taskInstanceId}/notifications
You can define user/group details to which email can be send in the request payload:
{
"from" : "test#jbpm.org",
"reply-to" : "no-reply#jbpm.org",
"users" : [ "john" ],
"emails" : [ "emails#jbpm.org" ],
"groups" : null,
"subject" : "reminder",
"body" : "my test content"
}

FCM API returns a success response but push notification is not delivered to user

I am sending push notification using FCM legacy API and by request looks like the following
POST https://fcm.googleapis.com/fcm/send
{
"to" : "USER-DEVICE-TOKEN",
"collapse_key" : "type_a",
"priority" : "high",
"notification" : {
"body" : "Getting this?",
"title": "Let me know if you got this message",
"icon": "ic_launcher"
},
"data": {
"one": "two"
}
}
This request returns the following response
{
"multicast_id": 144107415xxxxxxxxx,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:1581xxxxx5%32xxxxxxxxx"
}
]
}
But the user never receives any push notification. This happens for most of the user but about 10% of total user does receive push notification send by the same mechanism. I am out of sorts regarding this, I don't know whats going on or even how to go about debugging this. Has anyone run into this issue? The app is written in React Native and uses invertase/react-native-firebase for firebase features. Thanks

Unnable to make Google Cloud Messaging Work

I followed the new tutorial Implementing GCM Client on Android, and I'm unnable to make it work.
I get the token form my device succesfully, and when I send the following message
{
"to": "f19jCbaw-S4:APA91b....",
"notification": {
"body": "body",
"title": "title"
},
"data": {
"message": "test"
}
}
to https://gcm-http.googleapis.com/gcm/send, I get the result:
{
"multicast_id": 844556567...,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:1433092445706613%..."
}
]
}
But my app is never entering into the the onMessageReceived of MyGcmListenerService class. The only clue that I have is the following log trace:
6399-6454/com.miapp.app W/GcmNotification﹕ Failed to show notification: Missing icon
I'm duplicated step by step the Google Cloud Messaging Quickstart sample project. Obviusly I use my api key and my sender id... but id does not work, my app never stops in my onMessageReceived method.
Anybody else is having this problem?
In fact the payload without notification should reach the "onMessageReceived" method and work fine, but if the notification is present into the payload, the same error is displayed "Failed to show notification: Missing icon".
I tried to set the icon inside the AndroidManifest.xml (on the both intent-filter, on the receiver), but nothing worked.
If you do not require notification, just remove them from the payload.
And if you need the notification, you need to add another required field inside the notification:
If your icon is inside the mipmap you can add:
"icon" : "ic_launcher"
if your icon is inside the drawable, you should have:
"icon" : "#drawable/ic_myicon"
So your new request would look like:
{
"to": "f19jCbaw-S4:APA91b....",
"notification": {
"body": "body",
"title": "title",
"icon" : "#drawable/ic_myicon"
},
"data": {
"message": "test"
}
}