Skip to content
Draft
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
176 changes: 176 additions & 0 deletions CenterofExcellenceResources/ANSWER-RestrictMakerNotifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# ANSWER: Can we target maker notification email to specific environment?

## Original Question

> Hi Team, I want to restrict the maker notification email to specific environment. Kindly suggest do we have any configuration settings for the same or can we restrict the maker notification emails to specific set of users to do test pilot run

## Answer

**Yes, you can restrict maker notification emails to specific environments or specific users for pilot testing!**

While the CoE Starter Kit doesn't have out-of-the-box configuration settings for this, you can achieve it through flow customization. We've created comprehensive documentation to help you implement this.

## Quick Solutions

### Option 1: Restrict to Specific Environments ⚙️

**Best for**: Excluding production environments, targeting dev/test environments only

**How it works**:
1. Create an environment variable with allowed environment GUIDs
2. Modify notification flows to check if the maker's environment is in the allowed list
3. Only send emails if the environment matches

**Implementation time**: ~30 minutes
**📖 Full Guide**: [How-To: Restrict Notifications to Specific Environments](./HowTo-RestrictNotificationsToEnvironment.md)

### Option 2: Restrict to Specific Users (Pilot Testing) 👥

**Best for**: Pilot runs, phased rollouts, testing with specific teams

**How it works**:
1. Create an environment variable with pilot user email addresses
2. Modify notification flows to check if the maker is in the pilot list
3. Only send emails to pilot users

**Implementation time**: ~20 minutes
**📖 Full Guide**: [How-To: Restrict Notifications to Pilot Users](./HowTo-RestrictNotificationsToPilotUsers.md)

### Option 3: Combine Both 🎯

**Best for**: Maximum control - pilot users in specific environments only

**Implementation time**: ~45 minutes

## Available Documentation

We've created comprehensive documentation to help you implement these solutions:

1. **[Quick Reference Guide](./QuickReference-MakerNotificationFiltering.md)** 👈 **Start here for fast answers!**
- Quick solutions and comparison
- Common scenarios
- Troubleshooting tips

2. **[Overview: Filtering Maker Notifications](./FilteringMakerNotifications.md)**
- All available options
- Best practices
- Upgrade considerations

3. **[Step-by-Step: Environment Filtering](./HowTo-RestrictNotificationsToEnvironment.md)**
- Detailed implementation steps
- PowerShell commands to get environment IDs
- Flow modification examples
- Testing procedures

4. **[Step-by-Step: Pilot User Filtering](./HowTo-RestrictNotificationsToPilotUsers.md)**
- Detailed implementation steps
- Multiple approaches (environment variable vs. custom table)
- User management procedures
- Rollout planning

5. **[Resources README](./README.md)**
- Complete index of all guides
- Additional resources and support

## Affected Flows

These flows can be customized to restrict notifications:

- **Admin | Welcome Email v3** - Welcome email to first-time makers
- **Admin | Compliance Details Request eMail (Apps)** - App compliance requests
- **Admin | Compliance Details Request eMail (Flows)** - Flow compliance requests
- **Admin | Compliance Details Request eMail (Custom Connectors)** - Connector compliance
- **Admin | Compliance Details Request eMail (Chatbots)** - Chatbot compliance
- **Admin | Compliance Details Request eMail (Desktop Flows)** - Desktop flow compliance

## Key Benefits

✅ **Environment Filtering**:
- Exclude production environments
- Target only dev/test environments
- Control by environment type

✅ **Pilot User Filtering**:
- Test with small group first
- Gradual rollout
- Easy to add/remove users
- Department or team-based targeting

✅ **Flexible & Reversible**:
- No breaking changes
- Can disable filtering anytime
- Easy to expand to all users/environments

## Implementation Approach

### High-Level Steps:

1. **Choose your approach** (environment, users, or both)
2. **Create environment variable(s)** to store allowed environments/users
3. **Modify flows** to add filtering logic
4. **Test** with pilot environment/user
5. **Verify** non-pilot entities don't receive notifications
6. **Gradually expand** to more environments/users

### Example Configuration:

**Environment Variable for Environments**:
```
Name: admin_NotificationAllowedEnvironments
Value: guid1,guid2,guid3
```

**Environment Variable for Pilot Users**:
```
Name: admin_NotificationPilotUsers
Value: user1@contoso.com;user2@contoso.com;user3@contoso.com
```

## Important Considerations

⚠️ **Upgrade Impact**:
- Flow modifications may be overwritten during CoE Starter Kit upgrades
- Export modified flows before upgrading
- Document your changes for reapplication

✅ **Best Practices**:
- Test in non-production environment first
- Start with small pilot group
- Monitor flow run history
- Document all changes
- Plan for gradual rollout

## Support & Resources

- **GitHub Repository**: [microsoft/coe-starter-kit](https://github.com/microsoft/coe-starter-kit)
- **Official Documentation**: [Microsoft Learn - CoE Starter Kit](https://learn.microsoft.com/power-platform/guidance/coe/starter-kit)
- **Community Forum**: [Power Platform Community](https://powerusers.microsoft.com/)
- **Report Issues**: [GitHub Issues](https://github.com/microsoft/coe-starter-kit/issues)

## Next Steps

1. **Read the Quick Reference**: Start with [QuickReference-MakerNotificationFiltering.md](./QuickReference-MakerNotificationFiltering.md)
2. **Choose your approach**: Environment filtering, user filtering, or both
3. **Follow the detailed guide**: Implementation takes 20-45 minutes
4. **Test thoroughly**: Verify in non-production first
5. **Roll out gradually**: Start small and expand

## Questions?

If you have questions or need help:
- Review the detailed documentation linked above
- Check [GitHub Issues](https://github.com/microsoft/coe-starter-kit/issues) for similar questions
- Ask in the [Power Platform Community](https://powerusers.microsoft.com/)
- File a new issue if you encounter problems

---

**Summary**: Yes, you can restrict maker notifications to specific environments or users! Follow our step-by-step guides to implement environment filtering, pilot user testing, or both. Implementation takes 20-45 minutes and is fully reversible.

**Recommended Starting Point**: [Quick Reference Guide](./QuickReference-MakerNotificationFiltering.md)

---

*Created: December 2024*
*Applies to: CoE Starter Kit v3.x and later*
*Documentation Source: [CenterofExcellenceResources](./)*
163 changes: 163 additions & 0 deletions CenterofExcellenceResources/FilteringMakerNotifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Filtering Maker Notifications by Environment

## Overview

This guide explains how to restrict maker notification emails to specific environments or specific sets of users in the CoE Starter Kit Governance solution. This is useful when you want to:

- Run a pilot test with a subset of users
- Exclude certain environments from notifications
- Target notifications to specific environments only

## Maker Notification Flows

The CoE Starter Kit includes several flows that send notifications to makers:

1. **Admin | Welcome Email v3** - Sends a welcome email when a user creates their first app, flow, custom connector, or environment
2. **Admin | Compliance Details Request eMail (Apps)** - Requests compliance information from app owners
3. **Admin | Compliance Details Request eMail (Flows)** - Requests compliance information from flow owners
4. **Admin | Compliance Details Request eMail (Custom Connectors)** - Requests compliance information from custom connector owners
5. **Admin | Compliance Details Request eMail (Chatbots)** - Requests compliance information from chatbot owners
6. **Admin | Compliance Details Request eMail (Desktop Flows)** - Requests compliance information from desktop flow owners

## Option 1: Filter by Environment

To restrict notifications to specific environments, you can modify the flows to add environment filtering logic:

### Steps:

1. **Open the flow** you want to modify in Power Automate
2. **Add a condition** after the trigger that checks the environment:
- Get the environment information from the maker or resource record
- Compare the environment ID or name against your allowed list
3. **Add a Filter step** using one of these approaches:

#### Approach A: Using Environment Variable

Create a new environment variable to store allowed environment IDs:
```
Name: admin_NotificationAllowedEnvironments
Type: String
Value: env1-guid,env2-guid,env3-guid
```

Then in your flow, add a condition:
```
If environment ID is in admin_NotificationAllowedEnvironments
Then: Continue with notification
Else: Terminate
```

#### Approach B: Using Dataverse Table

Create a custom table to manage allowed environments:
- Table: "Notification Environment Allowlist"
- Columns: Environment ID, Environment Name, Allow Notifications (Yes/No)

In your flow, add a "List rows" action to check if the environment is in the allowlist.

### Example Flow Modification:

```
Trigger: When a record is created/updated
Get Environment Details (if not already in trigger data)
[Condition] Is environment in allowed list?
├─ Yes → Continue with existing notification logic
└─ No → Terminate
```

## Option 2: Filter by User/Maker

To run a pilot test with specific users, you can filter notifications based on the maker's email or user ID:

### Steps:

1. **Create a Dataverse table** for pilot users:
- Table Name: "Notification Pilot Users"
- Columns: User Email, User ID, Include in Pilot (Yes/No)

2. **Modify the flow** to check if the maker is in the pilot list:
```
Trigger
Get Maker Information
List rows from "Notification Pilot Users" where Email = Maker Email
[Condition] Is maker in pilot list?
├─ Yes → Send notification
└─ No → Terminate
```

### Example Using Environment Variable:

Create an environment variable with pilot user emails:
```
Name: admin_NotificationPilotUsers
Type: String
Value: user1@contoso.com,user2@contoso.com,user3@contoso.com
```

Add a condition in the flow:
```
If maker email contains in admin_NotificationPilotUsers
Then: Send notification
Else: Terminate
```

## Option 3: Disable Flows for Non-Pilot Environments

The simplest approach during a pilot:

1. **Turn off** the notification flows in all environments except your pilot environment
2. **Import** the Governance solution only into the pilot environment
3. **Use environment-specific configuration** by setting different values for environment variables

## Option 4: Filter Using Dataverse Views

For compliance detail request emails that are triggered by record updates:

1. **Modify the trigger** to use a filtered view
2. **Create a custom view** in Dataverse that filters records based on environment
3. **Update the flow trigger** to use this filtered view instead of the default view

## Best Practices

1. **Document Your Changes**: Keep track of all flow modifications for future upgrades
2. **Use Environment Variables**: Makes it easier to manage configurations across environments
3. **Test Thoroughly**: Always test in a non-production environment first
4. **Consider Upgrade Impact**: Custom modifications may need to be reapplied after CoE Starter Kit upgrades
5. **Use Separate Solutions**: Consider exporting modified flows to a separate solution layer to preserve changes during upgrades

## Important Considerations

### Upgrade Impact
- **Managed Solution Updates**: If you modify flows directly, your changes may be overwritten during CoE Starter Kit upgrades
- **Recommendation**: Create unmanaged customizations or use a separate solution layer
- **Alternative**: Fork the flows into a separate solution and turn off the original flows

### Licensing
- Ensure makers in pilot environments have appropriate licenses for the CoE Starter Kit features
- Environment filtering doesn't affect licensing requirements

### Audit and Compliance
- If filtering by environment, ensure you're still meeting compliance requirements for all environments
- Consider documenting why certain environments are excluded from notifications

## Related Resources

- [CoE Starter Kit Documentation](https://learn.microsoft.com/power-platform/guidance/coe/starter-kit)
- [Governance Solution Documentation](https://learn.microsoft.com/power-platform/guidance/coe/governance-components)
- [Environment Management](https://learn.microsoft.com/power-platform/admin/environments-overview)

## Support

For questions or issues:
- Check the [GitHub Issues](https://github.com/microsoft/coe-starter-kit/issues)
- Refer to the [CoE Starter Kit Wiki](https://github.com/microsoft/coe-starter-kit/wiki)
- Join the [Power Platform Community](https://powerusers.microsoft.com/)

---

**Note**: The CoE Starter Kit is provided as-is and customizations are your responsibility to maintain. Always test changes in a non-production environment first.
Loading