在发送电子邮件之前,我正在使用InboxSDK的presending检查条件。对于案例selectedProject!==0,不会发送电子邮件。有没有人有什么意见。
composeView.on('presending', (event) => {
if(selectedProject!==0){
//console.log(selectedProject);
composeView.send();
}else{
console.log(selectedProject);
event.cancel();
console.log('please select a project for the email');
alert('please select a project for the email');
initDropdown();//show the dropdown to select projects
}发布于 2020-08-28 05:36:08
从预先发送的处理程序中,如果你想发送,你需要通过返回来结束函数,如果你调用composeView.send();,它会进入一个循环,再次调用预先发送的处理程序。
composeView.on('presending', (event) => {
if(selectedProject !== 0){
return;
} else {
...
event.cancel();
...
}如果您想稍后发送,您需要设置一个在预发事件上选中的标志,以避免再次运行它。
composeView.on('presending', (event) => {
if(myForceSendFlag || selectedProject !== 0){
return;
} else {
...
event.cancel();
...
}我知道有点晚了,但我希望这能有所帮助。
https://stackoverflow.com/questions/61358032
复制相似问题