send an email to an O365 group

Copper Contributor

Hi, I want to be able to send an email message to a specific O365 group from a SharePoint site.
Is that possible? Is there a Web Part with corresponding form fields?

8 Replies
You could connect flow to forms to do it, but the quick and easy way is use Text webpart. Put in your text and then hyperlink to mailto:groupaddress@company.com

Not sure it this is what you need, but another way is to use the list view and add a customer format for the column with the person in.

 

Create a list, add a person field. Then click on the column header and format this column as follows:

Column formating.PNG

A panel will open at the right, allowing you to paste in json.

Info for setting this up can be found here:

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting

 

I just pasted one of the example on that page, and it created the little red email icon in the pic above. When clicking on that it opens a pre-defined email template.

 

Here's the json I from the example, which I then tweaked as I needed:

{ "elmType": "div", "children": [ { "elmType": "span", "style": { "padding-right": "8px" }, "txtContent": "@currentField.title" }, { "elmType": "a", "attributes": { "iconName": "Mail", "class": "sp-field-quickAction", "href": { "operator": "+", "operands": [ "mailto:", "@currentField.email", "?subject=Task status&body=Hey, how is your task coming along?.\r\n---\r\n", "@currentField.title", "\r\nClick this link for more info. http://contoso.sharepoint.com/sites/ConferencePrep/Tasks/Prep/DispForm.aspx?ID=", "[$ID]" ] } } } ] } 

 

It can be a person or a group is the same.

To not use a person column and use a column with an email address (group email name) I used this json, note my field name is [$Key_x0020_Contact_x0020_Email] you would need to change that for your field name:

{
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"padding-right": "8px"
},
"txtContent": "@currentField"
},
{
"elmType": "a",
"attributes": {
"iconName": "Mail",
"class": "sp-field-quickActions",
"href": {
"operator": "+",
"operands": [
"mailto:",
"[$Key_x0020_Contact_x0020_Email]",
"?subject=\r\n---\r\n"
]
}
}
}
]
}

emailtest1.PNGHi and thank you. I don`t know how to change the field name.

I want to send the text an attachments to the group.

 

 

I  don`t know what you mean with the text Webpart.

When I want to create a new app, there is no ext Webpart.

Do you have a screenshot?

Yeah a text webpart from editing a modern page.

Are you on SharePoint Online? You tagged it as such. Are you using a modern page or a classic page?

The other thing is, you said e-mail a group, do you want the person using the page to send the e-mail via their mail client? if so all you need is to put a mailto: link somewhere on the page with the group e-mail address and a subject line parameter. If you want an actual form that send's an e-mail to the group that asks for inputs then your'e going to have to create a custom power app list form to accomplish this, or use an older SharePoint workflow on a list.

If you are using a person then use the original jason.

 

If you are using a text field then you need to go through the json and change the name. For your field called group the json would be:

 

{
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"padding-right": "8px"
},
"txtContent": "@currentField"
},
{
"elmType": "a",
"attributes": {
"iconName": "Mail",
"class": "sp-field-quickActions",
"href": {
"operator": "+",
"operands": [
"mailto:",
"[$Group]",
"?subject=\r\n---\r\n"
]
}
}
}
]
}

 

for sender it would be:

{
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"padding-right": "8px"
},
"txtContent": "@currentField"
},
{
"elmType": "a",
"attributes": {
"iconName": "Mail",
"class": "sp-field-quickActions",
"href": {
"operator": "+",
"operands": [
"mailto:",
"[$Sender]",
"?subject=\r\n---\r\n"
]
}
}
}
]
}

 

Hi Stephen,

Thank You.
But ' Change the name ': What word do I need to change?
The Mail icon is not displayed.

No email will be sent.

 emailtest1.jpg

 

It would be best if the message I would not only stored in the list, but it would be sent automatically with the save. (button "speichern")

 emailtest2.jpg

 

Best regards

 

Olaf