Skip to content

Commit

Permalink
index
Browse files Browse the repository at this point in the history
  • Loading branch information
AnseGit committed Sep 4, 2024
1 parent 1314435 commit 8fb9981
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions force-app/main/default/lwc/offerForm/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://sosbarnebyer--uat.sandbox.my.salesforce-sites.com/preferencecenter/lightning/lightning.out.js"></script>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
</head>
<body>
<!-- Start Copy Lightning Out -->
<div data-lightning-out="true"></div>
<script>
const siteEndpoint =
"https://sosbarnebyer--uat.sandbox.my.site.com/preferencecenter";
const appName = "c:UserPreferenceApp";
const componentName = "c:userPreferenceWrapper";
const targetElm = document.querySelector("[data-lightning-out]");
const componentAttributes = {};
const queryParams = new URLSearchParams(window.location.search);
const sfId = queryParams.get("sfId");
const hashId = queryParams.get("hashId");
if(sfId){
componentAttributes.individualId = sfId;
}
if(hashId){
componentAttributes.hashId = hashId;
}
const callbackFunction = function (cmp) {};
// Init Lightning Out through Aura App then create LWC in targetElm
$Lightning.use(appName, function () {
$Lightning.createComponent(
componentName,
componentAttributes,
targetElm,
callbackFunction
);
siteEndpoint;
});
</script>
<!-- End Copy Lightning Out -->
</body>
</html>

0 comments on commit 8fb9981

Please sign in to comment.