Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion documentation/New-PnPVivaEngageCommunity.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Creates a Viva engage community
## SYNTAX

```powershell
New-PnPVivaEngageCommunity [[-DisplayName] <string> [-Description] <string> [-Privacy] <CommunityPrivacy>] [-Connection <PnPConnection>]
New-PnPVivaEngageCommunity [[-DisplayName] <string> [-Description] <string> [-Privacy] <CommunityPrivacy>] [-Owners <string[]>] [-Connection <PnPConnection>]
```

## DESCRIPTION
Expand Down Expand Up @@ -89,6 +89,20 @@ Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -Owners
The owners of the Viva engage community. This is mandatory if application permissions are used else the request will fail.

```yaml
Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
14 changes: 7 additions & 7 deletions documentation/Send-PnPMail.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Allows defining what type of content is in the Body parameter. Defaults to HTML.

```yaml
Type: MessageBodyContentType
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
Parameter Sets: Send through Microsoft Graph
Accepted values: Html, Text

Required: False
Expand Down Expand Up @@ -153,7 +153,7 @@ The sender of the e-mail. When Microsoft Graph is used, this can be a user or a

```yaml
Type: String
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
Parameter Sets: Send through Microsoft Graph

Required: True
Position: Named
Expand All @@ -167,7 +167,7 @@ Allows defining what the importance of the e-mail is. Defaults to Normal.

```yaml
Type: MessageImportanceType
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
Parameter Sets: Send through Microsoft Graph
Accepted values: Low, Normal, High

Required: False
Expand All @@ -182,7 +182,7 @@ List of return addresses to use for the e-mail

```yaml
Type: String[]
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
Parameter Sets: Send through Microsoft Graph

Required: False
Position: Named
Expand All @@ -196,7 +196,7 @@ Allows indicating if the sent e-mail should be stored in the Sent Items of the m

```yaml
Type: String[]
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
Parameter Sets: Send through Microsoft Graph

Required: False
Position: Named
Expand Down Expand Up @@ -238,7 +238,7 @@ List of attachments from local file system to be uploaded and sent as attachment

```yaml
Type: String[]
Parameter Sets: Send through Microsoft Graph with attachments from local file system
Parameter Sets: Send through Microsoft Graph

Required: False
Position: Named
Expand All @@ -252,7 +252,7 @@ List of files from the SharePoint site collection to be sent as attachments.

```yaml
Type: String[]
Parameter Sets: Send through Microsoft Graph with attachments from SPO
Parameter Sets: Send through Microsoft Graph

Required: False
Position: Named
Expand Down
26 changes: 13 additions & 13 deletions src/Commands/Utilities/SendMail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,63 @@ namespace PnP.PowerShell.Commands.Utilities
[Cmdlet(VerbsCommunications.Send, "PnPMail", DefaultParameterSetName = ParameterSet_SENDTHROUGHSPO)]
public class SendMail : PnPWebCmdlet
{
private const string ParameterSet_SENDTHROUGHGRAPH = "Send through Microsoft Graph with attachments from local file system";
private const string ParameterSet_SENDTHROUGHSPO = "Send through SharePoint Online";
private const string ParameterSet_SENDTHROUGHGRAPHWITHFILES = "Send through Microsoft Graph with attachments from SPO";
private const string ParameterSet_SENDTHROUGHGRAPH = "Send through Microsoft Graph";

[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public string From;

[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHSPO)]
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public string[] To;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHSPO)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public string[] Cc;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHSPO)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public string[] Bcc;

[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHSPO)]
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public string Subject;

[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHSPO)]
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public string Body;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public MessageImportanceType Importance;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public string[] ReplyTo;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public bool? SaveToSentItems;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
public MessageBodyContentType? BodyContentType;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
public string[] Attachments;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPHWITHFILES)]
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SENDTHROUGHGRAPH)]
public FilePipeBind[] Files;

protected override void ExecuteCmdlet()
{
// Runtime validation to prevent both attachment types being used together
if (ParameterSpecified(nameof(Attachments)) && ParameterSpecified(nameof(Files)))
{
ThrowTerminatingError(new ErrorRecord(
new PSArgumentException("You cannot use both -Attachments and -Files parameters together."),
"SendMailAttachmentConflict",
ErrorCategory.InvalidArgument,
this));
return;
}

if (string.IsNullOrWhiteSpace(From))
{
LogDebug("Sending e-mail through SharePoint Online");
Expand Down
Loading