Notifying New Release of Google APIs and Google Apps Script with Email using Google Apps Script


This is a sample script for notifying the new release of Google APIs and Google Apps Script with an email using Google Apps Script.

Recently, I published a sample script of “Retrieving Release Notes of Google Apps Script and Google APIs from RSS using Google Apps Script”. After this was published, I got an email that it wants to automatically notice the new release of Google APIs and Google Apps Script with an email. From this, I prepared a sample script as follows.

Sample script

Please set your email address to email in main. When you use this script, please manually run main function. By this, at 1st run, the new release in one month is checked as a test. And, the current date is stored in the PropertiesService. When you want to automatically obtain the notification, please install the time-driven trigger to main. For example, I run main one time at 00:00-01:00 every day. By this, when the new release is added, the email can be received.

// ref:

const sendEmail_ = (obj) => MailApp.sendEmail(obj);

function getData_({ urls, checkDate }) {
  const reqs = => ({ url, muteHttpExceptions: true }));
  const res = UrlFetchApp.fetchAll(reqs);
  const values = res.reduce((ar, r) => {
    if (r.getResponseCode() == 200) {
      const xml = XmlService.parse(r.getContentText());
      const root = xml.getRootElement();
      const ns = root.getNamespace();
      const updated = new Date(root.getChild("updated", ns).getValue());
      if (updated.getTime() > checkDate) {
        const title = root.getChild("title", ns).getValue();
        const entries = root.getChildren("entry", ns).map((e) => {
          const updated = new Date(e.getChild("updated", ns).getValue());
          const href = e.getChild("link", ns).getAttribute("href").getValue();
          const content = e.getChild("content", ns).getValue().trim();
          return [updated, href, content];
        ar = [, => [title, updated, ...e])];
    return ar;
  }, []);
  return values;

// Please run this function.
function main() {
  const email = "###"; // Please set your email address. The message is sent to the email.

  try {
    const urls = [

    const prop = PropertiesService.getScriptProperties();
    const checkDate = ((prop) => {
      const k = prop.getProperty("checkDate");
      if (!k) {
        const d = new Date();
        d.setMonth(d.getMonth() - 1);
        return d.getTime();
      return new Date(k).getTime();
    const values = getData_({ urls, checkDate });
    if (values.length > 0) {
        to: email,
        subject: "Update release note.",
        body: JSON.stringify(values, null, 2),
    prop.setProperty("checkDate", new Date().toISOString());
  } catch (e) {
      to: email,
      subject: "Error from Update release note.",
      body: JSON.stringify(e, null, 2),