Amandeep Midha
Amandeep Midha

Reputation: 78

What Zendesk app.js example to refer for sending external email notifications or AJAX requests?

Any ideas on a reference app or sample code having external SMTP mail integration as well as cross domain AJAX requests can be displayed?

Upvotes: 0

Views: 169

Answers (1)

mathielo
mathielo

Reputation: 6795

Take a look at the Example Apps provided by Zendesk. In there you will find a large variety of examples, including external REST API requests.

You probably won't be able to send emails from within the Zendesk App, but you might develop your own external API to do so and call your API endpoint from the app:

// Code from Zendesk's Example Apps.
// All you need is to register your request
requests: {
  // This is a simple object style.
  fetchHeartyQuotes: {
    url: 'http://www.iheartquotes.com/api/v1/random?max_characters=140&source=macintosh+math+south_park+codehappy+starwars&format=json',
    type: 'GET',
    dataType: 'json'
  },
  // ...
}

And then whenever you want to load external data you may invoke this.ajax('fetchHeartyQuotes');. Check the examples and request events docs to manage requests callbacks.

Upvotes: 1

Related Questions