I am trying to create tickets on my Zendesk and that is working fine. However i do not want Zendesk to email the creator of the tickets (his or her email). Is this possible?
The idea is i have a contactForm widget on my site, i want the submits from this form to create tickets in my Zendesk.
Creating tickets is currently working using this code:
$zendesk = new zendesk(
$row->api_key,
$row->email_address,
$row->host_address,
$suffix = '.json',
$test = false
);
$arr = array(
"z_subject"=>"Offline Message",
"z_description"=> $r->contact_msg,
"z_recipient"=>$r->contact_email,
"z_name"=>$r->contact_name,
);
$create = json_encode(
array('ticket' => array(
'subject' => $arr['z_subject'],
'description' => $arr['z_description'],
'requester' => array('name' => $arr['z_name'],
'email' => $arr['z_requester']
))),
JSON_FORCE_OBJECT
);
$data = $zendesk->call("/tickets", $create, "POST");
Any ideas?
Totally possible! You need to add some conditions to the trigger "Notify requester of received request" in Zendesk - Trigger setting to prevent zendesk from sending email. For ex:
Ticket : Channel - Is Not - Webservice (API)
Ticket : Tags - Contains one of the following - "offline message"
You could use another API endpoint "Ticket Import" https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_import/
It's do not send notifications
Related
There is currently 25k+ users we have in database. All users are subscribed to a common topic All.
I have two directories inside public_html. First is for API built in codeigniter. This API is used to provide data for all adnroid and iOS devices.
Second directory is for admin panel built in Laravel. We use it to upload data and also to send notification to firebase topics.
Both API and Admin Panel share same database.
If we send notification to topics which is not subscribed by much
users, there is no issue. But If I send notificaiton to a topic
which has much users It causes problems on our backend. The API
stops responding, or sometimes takes too long to respond.
Sometimes also admin panel stops responding too.
I am so confused because all the things are handled by firebase. I just make one API call.
Can anyone explain what's causing the problem?
Or any possible reason?
Update
use Kreait\Firebase\Messaging;
use Illuminate/Support/Http/Request;
trait UserTrait {
public function notify(Request $request, Messaging $messaging) {
$message_hi = array(
"notification_type" => $notification_type,
"notification_title" => $notification_title_hi,
"icon_image" => $icon_image,
"notification_description" => $request->notificationText_hi,
"image_url" => $request->image_url,
);
$message = array(
"notification_type" => $notification_type,
"notification_title" => $notification_title,
"icon_image" => $icon_image,
"notification_description" => $request->notificationText,
"image_url" => $request->image_url,
);
$commodityIdArray = $request->cId
//to send all
if($request->notification_type == 1) {
$messaging->sendAll([
['topic' => 'All', 'data' => $message],
['topic' => 'All_hi', 'data' => $message_hi],
]);
} else {
//to send to a fourite topic subscribed by some users
//Prepare Condition for both hindi and english users
$topic_condition = "";
$topic_condition_hi = "";
foreach($commodityIdArray as $topic) {
$topic_condition .="'".$topic."' in topics && ";
$topic_condition_hi.="'".$topic."_hi' in topics &&";
}
//send notification to hindi and english topics
$messaging->sendAll([
['condition' => substr($topic_condition, 0, -3), 'data' =>
$message],
['condition' => substr($topic_condition_hi, 0, -3), 'data' =>
$message_hi],
]);
}
}
Use Queue
You have to use a Queue which set your process in queue and when one process completes, the second one starts
you can also set number of retries of your process
I am trying to trigger the send of a smart transactional email in Campaign Monitor from my Wordpress app
require_once( get_stylesheet_directory() . '/createsend-php-master/csrest_transactional_smartemail.php' );
# Authenticate with your API key
$auth = array('api_key' => 'apikey');
# The unique identifier for this smart email
$smart_email_id = 'emailid';
# Create a new mailer and define your message
$wrap = new CS_REST_Transactional_SmartEmail($smart_email_id, $auth);
$message = array(
"To" => 'email#email.com',
"Data" => array(
'x-apple-data-detectors' => 'x-apple-data-detectorsTestValue',
'href^="tel"' => 'href^="tel"TestValue',
'href^="sms"' => 'href^="sms"TestValue',
'owa' => 'owaTestValue',
),
);
# Send the message and save the response
$result = $wrap->send($message);
I've got the correct API and Email ID, and I'm using my gmail account to test with but the email just isn't getting triggered. I'm a beginner coder and I reckon I've just missed something completely obvious!
Path to the campaign monitor php file is correct too.
The API documentation is here https://www.campaignmonitor.com/api/transactional/?_ga=1.180877863.1694927084.1483423346 - is there anything I've missed out. Help is much appreciated!
I am trying to add subscriber to list through Getresponse api for single contact subscription to list i have to call api like this
$getresponse = new GetResponse(api key);
$result = $getresponse->addContact(listid,
$lead['name'],
$lead['email']
);
Now i want to add multiple emails at a single call, i cant use foreach loop for each contact, is there a function or endpoint to add multiple emails at a single call?
Getresponse official API shows only one contact.
https://apidocs.getresponse.com/v3/resources/contacts#contacts.create
As of now, there is no API endpoints for import contacts as bulk (csv or JSON).
Yes, Bala is correct. There is no such API method for GetResponse to insert multiple contacts. However, please check the below API codes to insert single contact to GetResponse.
include('GetResponseAPI3.class.php');
$getresponse = new GetResponse('your-getresponse-token-here');
$var = $getresponse->addContact(array
(
'name' => 'FirstName LastName',
'email' => 'emailid#something.com',
'dayOfCycle' => 0,
'campaign' => array('campaignId' => 'Campaign-id'),
'ipAddress' => 'XXX.XXX.XX.XX'
)
);
var_dump($var);
I want to use the Parse.com api to send push notifications but I need to send these push notifications from my CMS in PHP ...and not from Dashboard from parse.com. Its possible to integrate my CMS with parse`s dashboard? I have tried search in parse's doc but haven't found
here is the panel form
</div>
<div class="section_body">
<div id="push_errors" style="display: block;">Your message cannot be empty</div>
<div class="ui_action_button disabled" id="send_push"><span>Send now</span><i class="icon_send"></i></div>
</div>
</div>
https://parse.com/docs/push_guide#installations/PHP
$data = array("alert" => "Hi!");
ParsePush::send(array(
"channels" => ["PHPFans"],
"data" => $data
));
or:
$query = ParseInstallation::query();
$query->equalTo("design", "rad");
ParsePush::send(array(
"where" => $query,
"data" => $data
));
I think it is possible. Have a look at their docs here: https://parse.com/docs/push_guide#sending/PHP
For example (copied from docs):
"With the PHP SDK, the following code can be used to alert all
subscribers of the "Giants" and "Mets" channels about the results of
the game. This will display a notification center alert to iOS users
and a system tray notification to Android users."
$data = array("alert" => "Hi!");
ParsePush::send(array(
"channels" => ["PHPFans"],
"data" => $data
))
I'm using the following to post a message on my Facebook page:
$attachment = array(
'access_token' => $access_token,
'message' => 'This is a test Message 4:',
'name' => "This is a test Name 4",
'link' => "http://slashdot.org/",
'description' => "This is a test Description 4"
);
$ret_code=$facebook->api('/me/feed', 'POST', $attachment);
This works great.
How do I delete the same post using the facebook GRAPH api? I read the docs and it says to issue a POST like:
https://graph.facebook.com/COMMENT_ID?method=delete
To test I set this up in a simple form with submit button, POSTing the data to https://graph.facebook.com/COMMENT_ID?method=delete (substituting COMMENT_ID fro the 11111111111_111111111111 id returned from the original publish call. This returns "This API call requires a valid app_id".
What is the correct way to issue a DELETE command?
Since you are using the php-sdk you just issue this call:
$facebook->api("/COMMENT_ID","DELETE");
You can use the following code:
Http::post('https://graph.facebook.com/'.$fb_action_id, array('method'=>'delete', 'access_token'=>$your_app_access_token));
This post will return a boolean value, true if successed and false if failed.
Its been discussed here Facebook SDK and Graph API Comment Deleting Error
you need to pass the access token too. You can delete all the milestones of a page like follows:
$milestones = $facebook->api('/PAGE_ID/milestones');
foreach($milestones[data] as $milestone)
{
echo $milestone['id'];
$args = array(
'access_token' => $pages_access_token
);
$deleted = $facebook->api($milestone['id'],"delete",$args);
if($deleted)
{
echo " <font color=\"green\">OK</font><br>";
}
else
{
echo " <font color=\"red\">ERR</font><br>";
}
}