Person Mail To Link
You can use column formatting to render quick action links next to fields. This sample, intended for a person field, renders two elements inside the parent
<div /> element:
<span />element that contains the person’s display name.
<a />element that opens a mailto: link that creates an email with a subject and body populated dynamically via item metadata. The
<a />element is styled using the
sp-field-quickActionsclass and uses the
iconNameattribute to make it a clickable email icon.
- This format expects to be applied to a Person column
|1.0||November 2, 2017||Initial release|
|1.1||August 18, 2018||Changed from generic-action-button to person-mailto and switched to Excel-style expressions|
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
This sample is also covered in the main documentation around Column Formatting
A similar wizard is also included in the Column Formatter webpart that allows full customization.
An additional version using Abstract Tree Syntax (AST) is also provided for environments where the Excel-style expressions are not supported.