uma-sp
Version:
Utility functions to interact with SharePoint Online that builds on top of PnP-JS-Core.
39 lines (24 loc) • 1.24 kB
Markdown
A set of utilities that revolve around SharePoint.
npm install uma-sp --save
import * as uma from 'uma-sp';
You need to tell the library what is the SharePoint list name (a list that resides on the Root Web) that contains all your templates.
uma.emailSetup({
templatesListName: 'Workflow Email Templates'
});
The signature is getTemplateAndSend(templateName, templateParams, from, to, subject)
uma.email.getTemplateAndSend("Initiate", {Title: "TestEmail", Body: "Lorem Ipsum...."}, "system@tenant.onmicrosoft.com", "someone@tenant.onmicrosoft.com", "The subject of your email").then(result => {
console.log("Email sent successfully: " + result);
});
The signature is send(from, to, body, subject)
uma.email.send("system@tenant.onmicrosoft.com", "someone@tenant.onmicrosoft.com", "The content of the email...", "The subject of your email").then(result => {
console.log("Email sent successfully: " + result);
});
This package has dependencies on sp-pnp-js and lodash libraries