Skip to main content

Posts

Showing posts with the label Code Snippets

Office 365 & PNP PowerShell 2013 : Branding

The PNP branding section you can create custom action like link in the ribbon and other locations as well. For that you need to understand the Ribbon XML. You can check the following links to know about the ribbon xml.  Adding a Button to the Server Ribbon ` Add a custom ribbon to your sharepoint site Now let’s do some practical work. To create the ribbon with PNP powershell, I am going to use the Add‑PnPCustomAction . To get the all custom actions you need to use the Get‑PnPCustomAction command. And to remove the custom action we get use the above method to get the all the custom action and delete all the custom action just loop over the collection use the Remove‑PnPCustomAction .  In this example, I am going to use the CSV file to read the information and create the Ribbon based on the configuration. Here is the CSV files for both operation are identical only one different in Action column ‘Del’ and ‘Add’ for distinguish the operation. The c...

Send Email using SharePoint Rest API

We have a requirement to send email vai SharePoint Rest API. We dig and find the below solution to send email using SharePoint API. Point Must be remember End point " /_api/SP.Utilities.Utility.SendEmail " end point to send email.  In JSON __metadata we used the type " SP.Utilities.EmailProperties ". The User / Group must have a read permission for particular site. where we placed this site code. JS Dependency  JQuery Code URL:  https://gist.github.com/BasantPandey/05189832546f2c6cc0bd008fcfec3264#file-sharepointsendemail-js Code  var Email = function (){ // Email Either email groupname or email address var from = ' abc.yahoo.com ' , to = ' abc.yahoo.com ' , cc = ' abc.yahoo.com ' , subject = ' My Email Subject ' ; this . options = this . options || {}; this . options [ ' fromEmail ' ] = this . options [ ' fromEmail ' ] || {}; this . options [ ' toEmail ...