Alosyius
Alosyius

Reputation: 9111

Zendesk php api create ticket without sending email to the user?

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?

Upvotes: 1

Views: 2297

Answers (2)

FallDi
FallDi

Reputation: 670

You could use another API endpoint "Ticket Import" https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_import/

It's do not send notifications Zendesk Ticket Import

Upvotes: 0

Lam
Lam

Reputation: 436

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"

Upvotes: 1

Related Questions