Gmail Addon – Unable to Invoke composeTrigger Function for Updating Signature quotes in Compose Email popup Without Page Reload

We are currently experiencing an issue with the Signature quotes not updating in real-time. Presently, the Signature updates are only reflected after reloading the page. Our goal is to achieve real-time updates without requiring a page reload. We want, when we open the compose email popup, it displays the latest Signature quotes without needing a page reload

Our sample code, Updating Signature quotes is this Code.gs file

async function startApp() {
  let card = CardService.newCardBuilder();
  let attribute = await getAttribute();
  let att = attribute.data[0];
  let ancer = att.attribute;
  // card.addSection(CardService.newCardSection().addWidget(CardService.newTextParagraph().setText(ancer)));
  let newsResult = await getUsedSignatures();
  if (newsResult && newsResult.data.length > 0) {
    let signatures = newsResult.data;
    for (var i = 0; i < signatures.length; i++) {
      var daySection
      if (i === 0) {
        daySection = CardService.newCardSection().setHeader("<b>Today</b>");
      }
      else if (i === 1) {
        var daySection = CardService.newCardSection().setHeader("<b>Tomorrow</b>");
      }
      else {
        daySection = CardService.newCardSection().setHeader(`<b>${signatures[i].used_date}</b>`);
      }
      let cleanedQuote = signatures[i].quote;
      daySection.addWidget(CardService.newTextParagraph().setText(`<i style="color: #484643; font-family: 'Poppins', sans-serif;">${cleanedQuote}</i>`));
      let switchFieldName = `toggle_switch_${signatures[i].id}`;
      let defaultSwitchValue
      if (signatures[i].toggle === "TRUE") {
        defaultSwitchValue = true
      }
      else {
        defaultSwitchValue = false
      }
      let switchDecoratedText = CardService.newDecoratedText()
        .setText("")
        .setWrapText(true)
        .setSwitchControl(CardService.newSwitch()
          .setFieldName("quote_select")
          .setValue(switchFieldName)
          .setSelected(defaultSwitchValue)
          .setOnChangeAction(CardService.newAction()
            .setFunctionName("handleToggleSwitchChange")
            .setParameters({ switchName: switchFieldName })));
      daySection.addWidget(switchDecoratedText)
      card.addSection(daySection);
    }
    updateGmailSignature(signatures[0].quote, ancer, signatures[0].toggle);
  } else {
    card.addSection(CardService.newCardSection());
  }
  return card.build();
}

function updateGmailSignature(newSignature, ancer, switchFieldName) {
  if (switchFieldName === "TRUE") {
    let userEmail = Session.getActiveUser().getEmail();
    let profileSignature = {
      sendAsEmail: userEmail,
      signature: `${newSignature}n${ancer}`
    };
    try {
      let response = Gmail.Users.Settings.SendAs.patch(profileSignature, 'me', userEmail);
      Logger.log(response);
      Logger.log('Signature updated successfully.');
    } catch (error) {
      Logger.log('Error updating signature: ' + error);
    }
  } else {
    // If the toggle is off, remove the signature
    let userEmail = Session.getActiveUser().getEmail();
    let profileSignature = {
      sendAsEmail: userEmail,
      signature: ''
    };

    // Use the Gmail API to update the signature
    try {
      let response = Gmail.Users.Settings.SendAs.patch(profileSignature, 'me', userEmail);
      Logger.log(response);
      Logger.log('Signature removed successfully.');
    } catch (error) {
      Logger.log('Error removing signature: ' + error);
    }
  }
}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật