I have created quick action button to open outlook app,and behind the scene I Am using LWC Headless Action to make it happen.
following is my complete lwc code.
TestSendEmail.html
<template>
</template>
TestSendEmail.js
import { api, LightningElement } from 'lwc';
export default class TestSendEmail extends LightningElement {
@api invoke() {
var uri = "mailto:?subject=Test%20subject"+"&body="+encodeURIComponent("<table><tr><td>Test Html</td></tr></table>");
console.log("show uri: ", uri);
var a = document.createElement("a");
a.href = uri;
a.click();
}
}
TestSendEmail.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>54.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__RecordAction</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__RecordAction">
<actionType>Action</actionType>
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
And here's the button after added to page layout: But when I click the button, html does not get rendered properly on outlook app like this following image
The goal is only to open outlook app with correct rendered HTML. Hope anyone can help me fix this issue.
Thanks in advance