我正在为 gmail 创建 chrome 扩展程序,我想在用户单击我的扩展程序创建的按钮时发送邮件。我正在使用 inboxsdk 来创建扩展。
我正在使用以下代码创建按钮
InboxSDK.load('1', '**************').then(function(sdk){
// the SDK has been loaded, now do something with it!
sdk.Compose.registerComposeViewHandler(function(composeView){
// a compose view has come into existence, do something with it!
composeView.addButton({
title: "button-title-goes",
iconUrl: 'https://image.ibb.co/mXS2ZU/images.png',
onClick: function(event) {
console.log( event );
event.composeView.insertHTMLIntoBodyAtCursor('<img src="https://image.ibb.co/mXS2ZU/images.png" alt="Smiley face" height="1" width="1">');
},
});
});
});
当用户单击此按钮时,我想发送邮件。