function checkEmailQuotaAvailable() {
  var output = { state: "init", debug: {}, error: {} };
  try {
    var emailQuotaRemaining = MailApp.getRemainingDailyQuota();

    return emailQuotaRemaining > 0;
  } catch (error) {
    output = {...output , error}
    console.log('checkEmailQuotaAvailable error')
    console.log(output);
  }
}
