嗨,我正在使用 Cordova EmailComposer 插件,其中包含以下内容
Cordova.exec(null, null, "EmailComposer", "showEmailComposer", [args]);
我正在努力设置主题行和类似的信息。当我更改null
值时,它会破坏插件。
谢谢
用法:
// Define the arguments
var args = {
toRecipients : string,
ccRecipients : string,
bccRecipients : string,
subject : string,
body : string,
bIsHtml : boolean
};
尝试在 HTML 页面的正文中使用此示例代码。
<body>
<div class="app">
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
<center><button onclick="cordova.exec(null, null, 'EmailComposer', 'showEmailComposer', [args]);">Compose Email</button></center>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="js/EmailComposer.js"></script>
<script type="text/javascript">
app.initialize();
var args = {
toRecipients :["xyz@yahoo.co.in"],
ccRecipients :["abc@gmail.com"],
bccRecipients :["abc@gmail.com"],
subject :"Hello",
body : "HI",
bIsHtml : true
};
</script>
</body>
我找到了以下问题的答案
window.plugins.emailComposer.showEmailComposer("Subject","PlainTextBody", "recipient,recipient", "ccRecipient", "bccRecipient",false);