Just wondering if I could get some help. I built a small webpart that sends an email. On my local workbench it works fine however when I deploy to production
Error: Error making HttpClient request in queryable [404] Not Found ::>
My Import
import { sp, EmailProperties } from "@pnp/sp";
My OnInit establishes context
public onInit(): Promise<void> {
return super.onInit().then(_ => {
// establish SPFx context
sp.setup({
spfxContext: this.context
});
});
}
Send email
const emailProps: EmailProperties = {
To: ["[email protected]"],
Subject: "This email is about...",
Body: "Here is the body. <b>It supports html</b>"
};
sp.utility.sendEmail(emailProps).then(_ => {
console.log("Email Sent!");
});