Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import { sp, EmailProperties } from "@pnp/sp";
  2.  
  3. public onInit(): Promise<void> {
  4. return super.onInit().then(_ => {
  5. // establish SPFx context
  6. sp.setup({
  7. spfxContext: this.context
  8. });
  9.  
  10. });
  11. }
  12.  
  13. const emailProps: EmailProperties = {
  14. To: ["test@myorganisation.com"],
  15. Subject: "This email is about...",
  16. Body: "Here is the body. <b>It supports html</b>"
  17. };
  18.  
  19. sp.utility.sendEmail(emailProps).then(_ => {
  20. console.log("Email Sent!");
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement