Send an Email to all users in a D365 Team using power automate.
D365 gives us a functionality to assign a record to a group of users which can be archived by using a D365 Team these users then are know as members of that respective team, due to functionality restrictions we cannot send an email to a D365 team, however there are a few workarounds by which we can achieve this functionality.
Lets consider a case.
Suppose we have a D365 team called as “Accounts Associates” we have added a set of users in this team. Now if an invoice milestone is in the ready state i.e. “Ready For Invoicing” we need to send a reminder email to this “Accounts Associates” team to take an action regarding the ready invoicing.
Solution :-
The following case can be achieved by using an Out of the box functionality i.e. By using a distribution list
Note :- (we must have an Microsoft Exchange License).
Lets Begin with the implementation.
Step – 1 Creating a Distribution List
Login to your admin center (Link –https://admin.microsoft.com/)
![Microsoft 365 admin center
Resources
Billing
Q Support
Settings
Setup
Reports
Health
Admin centers
Security
Compliance
$6
Azure Active Directo...
Exchange
SharePoint
Teams
All admin centers](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-131.png)
In the Admin center Section of the Left navigation bar select “Exchange”.
![Admin
Exchange admin center
dashboard
recipients
permissions
compliance management
organization
protection
mail flow
mobile
public folders
unified messaging
hybrid
New Exchange admin center
Welcome
recipients
mailboxes
groups
resources
contacts
red
migration
organization
sharing
add-ins
mobile
mobile device access
permissions
admn roles
user roles
Outlook Web App policies
protection
malware filter
connection filter
spam filter
outbound spam
quarantine
action center
dkim
public folders
public folders
Try the new Exchange admin center
compliance management
in-place eDiscovery & hold
auditing
data loss prevention
retention policies
retention tags
journal rules
mail flow
rules
message trace
accepted domains
remote domains
connectors
unified messaging
UM dial plans](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-128-1024x480.png)
Under the “recipients” select “groups”.
In the “+ New Microsoft 365 Group” pull down the dropdown and add the distribution list.
![](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-133-1024x510.png)
Add the Display name and the “Alias” and save the Distribution list.
Add same users which are present in the teams to this Distribution list.
![](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-130-1024x482.png)
Step – 2 Creating a Queue in D365
Go to “Settings” -> “Service Management” ->” Queues” and click on “+NEW” -> give it a name -> “Save”
A mailbox would be created with the same name that of the queue.
Open the mailbox. The Email address field will be blank, add the Distribution List’s email address created in Step 1.
![](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-129-1024x551.png)
![](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-135-1024x485.png)
Step -3 Create a New Team or select an Existing Team. In the Default Queue lookup, select the Queue created in Step 2.
![](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-134-1024x480.png)
Step – 4 Create a Flow which triggers on update of a project contract line milestone i.e. When status is ready for invoicing
- Flow triggers when Project Contract Line is Updated, Condition Invoice Milestone is Ready for invoicing for which click on the “…” select settings and add the following condition in the trigger sectio
- Get the Teams ID in this case I have hardcoded the ID as no record was associated with it to retrieve it
- Get the Teams Details.
![](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-136-1024x485.png)
- Get the Default Queue to which the email will be triggered .
- Send an Email to the Incoming Email of that Queue which is Email ID set on the Distribution list.
- Note : (We will have to Manually add or remove the users from both the Distribution list and the Teams. i.e.
both the team and the distribution list must be sync,
- if a member is added or removed from the team the same should be done in the distribution list )
- Output .
![](https://www.cloudfronts.com/wp-content/uploads/2021/02/image-132-1024x549.png)
Hope this helps.!