rustyeddy
2/1/2015 - 7:52 PM

Success and failure handlers for Google Apps Web Apps. Place this in HTML for Google Apps HTML service.

Success and failure handlers for Google Apps Web Apps. Place this in HTML for Google Apps HTML service.

  <script>
    function onSuccess(numUnread) {
      alert('You have ' + numUnread + ' messages');
    }
    
    function onFailure(error) {
      alert(error.message);
    }

    
    google.script.run.withSuccessHandler(onSuccess).withFailureHandler(onFailure).getUnreadEmails();
    google.script.run.doSomething();
  </script>