如何通过闪电组件将附件添加到发送电子邮件快速操作 apI?


i need to populate the attachment on send email lightning quick action api. i can able to set the 
subject to the email quick action, but i need to add the attachment to the email. How can i send the 

从顶点到闪电组件的连接 如何将附件从顶点返回到闪电组件。以及如何为闪电快速操作 API 添加到 HtmlBody 参数?

你需要执行以下操作 1. 创建闪电流操作以触发顶点代码。 2.使用顶点代码触发电子邮件并附加附件。

我能够使用它附加它可能会对您有所帮助:

var actionAPI = component.find("quickActionAPI");
//var targetFields = {Subject:{value:"Sets by lightning:quickActionAPI component 3"}, HtmlBody:{value:'HTML BODY'}};
var targetFields = {
Subject:{
value:"Sets by lightning:quickActionAPI component"
}, 
HtmlBody:{
value:'HTML BODY'
},
ToAddress:{
value:'devid@testgmail.com'
},
ContentDocumentIds:{
value:['0691D000001cgXXXX']
}
};
var args = {actionName: "Quote.SendEmail", entityName: "Quote", targetFields: targetFields};

actionAPI.getAvailableActions(args).then(function(result){
//All available action fields shown for Log a Call
console.log('##getAvailableActions#result==', JSON.stringify(result));
}).catch(function(e){

console.error(e.errors);
if(e.errors){
//If the specified action isn't found on the page, show an error message in the my component 
}
});

actionAPI.getAvailableActionFields(args).then(function(result){
//All available action fields shown for Log a Call
console.log('##getAvailableActionFields#result==', JSON.stringify(result));
}).catch(function(e){

console.error(e.errors);
if(e.errors){
//If the specified action isn't found on the page, show an error message in the my component 
}
});

actionAPI.setActionFieldValues(args).then(function(response){
console.log('##WORKING#setActionFieldValues##', response, args);
//actionAPI.invokeAction(args);
console.log('##WORKING#setActionFieldValues##');
}).catch(function(e){
console.error(e.errors);
});

更多方法请点击此处:https://developer.salesforce.com/docs/atlas.en-us.case_feed_dev.meta/case_feed_dev/quickaction_api.htm

最新更新