Advent Calendar Door 3: Sending Emails
Hey, how do I send an email from SharePoint? That might be one of the most asked questions ever in the SharePoint world, and it is the subject of today's skybow Advent Calendar.
With skybow Solution Studio, skybow Action Links or skybow Rich Forms, this becomes a very simple task. Create a new Action Link, or new button, depends if you are in Action Links or form designer, and create one action. Choose "Send Mail" from the Type dropdown menu.
There, you are going to see all the fields which are associated with sending a mail, such as from, to, cc, bcc, subject and body. Let’s say we want to send an email from current user to a user stored in the user-type field in the SharePoint list.
In the “From” field, we will open the expression builder, and from the “User” context on the right side, choose an Email. This will result in setting the current user’s email placeholder as sender address.
Next, in the „Send to” field, open the expression builder, and choose an User-type field from the form fields on the right side. You can always choose the “Created by” (Author) field, which is present by default in each list. That will result with the placeholder for email address of the user from the selected field.
At last, we have to build the email template, for subject and body fields (procedure is identical). Open the expression builder for subject or body, choose the expression type to “Template” and start typing the subject or body. Use the placeholders from the right side to insert the information from list fields or user context directly into the email body/subject. The real text of the message will be resolved in the moment of sending, and placeholders will be replaced with real data.
And that’s it – your user will, by clicking on an action link or on a button, send an email to the “Author” of this list item with the message you have created. Simple and easy, achievable within the seconds, because – skybow!