0

When i use the inboxSDK with the newGmail I face an issue that the "event" did not get the composeView like the other events.

sdk.Compose.registerComposeViewHandler(function (composeView) {
        composeView.on("presending", function (event) {
    // Only get event.cancel(); 
    });
}

Did i do something wrong or it's a bug with the new Gmail UI ?

Cédric Boivin
  • 10,854
  • 13
  • 57
  • 98

1 Answers1

1

As of the documentation the presending callbacks event object only has the cancel method attached. And actually that is no problem at all since you already have the composeView availbale from the registerComposeViewHandlers scope. Just access that composeView object.

sdk.Compose.registerComposeViewHandler(function (composeView ) {
    composeView.on("presending", function (event) {
        console.log(composeView);
    });
}

If the presending event triggers you can just use event.cancel() to stop the sending, do whatever you wanna do on the composeView like you would for example in the registerComposeViewHandler callback and when you're done do composeView.send() to finally send the email. Just make sure to have a condition for the cancel event so you actually be able to send at one point and not get stuck in the presend event forever.