Skip to main content

Using SharePoint REST Services to Control Email Notifications

  • Chapter
  • First Online:
Book cover Creating Business Applications with Office 365
  • 1337 Accesses

Abstract

Many of the InfoPath applications that I write involve notification emails and workflows as in the previous chapter. In most cases, however, we want to notify an entire office or workgroup rather than a specific individual. A useful technique is to have each office in a custom SharePoint list. Figure 138 shows the layout of the Office Members list. Anyone in this list will have permissions for their office’s section of the form. Notice that the Member Name column is of type Person or Group. We display its Account field so that when we reference it from InfoPath, it will match up with its userName() function. Later, we will use SharePoint’s REpresentational State Transfer (REST) service to read this same list in order to send notification emails to only those members that have a SendNotificationEmails column set to true. While we are at it, we give each user the option for giving one or more AlternativeEmailAddress rather than using the one associated with their SharePoint account.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    See https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest.

  2. 2.

    This gives an easy way for the office to control notifications based on whether someone is in the office. Note that avoiding spaces in the column names is easier since each space needs an encoded _x200_ when using it with REST. Keep them relatively short as well to avoid issues when the names are being truncated.

  3. 3.

    Chrome will display the XML as well but not in a formatted state. In that case, you can paste the results into an XML editor such as Visual Studio.

  4. 4.

    This is important for us at the Air Force Academy because some users have both an “EDU” and “MIL” address. A SharePoint 2013 will only email to the primary account associated with SharePoint, but the 2010 can go to either one (as well organizational email addresses).

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Jeffrey M. Rhodes

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Rhodes, J.M. (2019). Using SharePoint REST Services to Control Email Notifications. In: Creating Business Applications with Office 365. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5331-1_20

Download citation

Publish with us

Policies and ethics