Skip to content

Commit f1d42c9

Browse files
Merge pull request #290645 from v-vprasannak/EmailServicesPreSendEmailAnalysis
Email services - Pre-send email - Azure AI to detect sensitive data
2 parents 870321a + 89decc9 commit f1d42c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

articles/communication-services/samples/email-detect-sensitive-content.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ From the application directory, install the Azure Communication Services Email c
7171

7272
`dotnet add package Microsoft.Azure.CognitiveServices.ContentModerator`
7373

74+
`dotnet add package Azure.AI.ContentSafety`
75+
7476
## Create the Main function
7577

7678
Open `Program.cs` and replace the existing contents with the following code. The `using` directives include the `Azure.Communication.Email` and `Azure.AI namespaces`. The rest of the code outlines the `SendMail` function for your program.
@@ -189,7 +191,7 @@ static async Task<bool> AnalyzeInappropriateContent(List<string> documents)
189191

190192
### Create the Content Safety client with authentication
191193

192-
Create a new function with a Content Safety client that also retrieves your connection information. Add the following code into the `AnalyzeInappropriateContent` function to retrieve the connection key and endpoint for the resource from environment variables named `CONTENT_LANGUAGE_KEY` and `CONTENT_LANGUAGE_ENDPOINT`. It also creates a new `ContentSafetyClient` variable. If you're using the same Azure AI instance for Text Analytics, these values remain the same. For more information about managing your Content Safety connection information, see [Quickstart: Detect Personally Identifiable Information (PII) > Create environment variables](/azure/ai-services/language-service/personally-identifiable-information/quickstart#create-environment-variables).
194+
Create a new function with a Content Safety client that also retrieves your connection information. Add the following code into the `AnalyzeInappropriateContent` function to retrieve the connection key and endpoint for the resource from environment variables named `CONTENT_LANGUAGE_KEY` and `CONTENT_LANGUAGE_ENDPOINT`. It also creates a new `ContentSafetyClient` variable. If you're using the same Azure AI instance for Text Analytics, these values remain the same. For more information about managing your Content Safety connection information, see [Quickstart: Create the Content Safety resource](/azure/ai-services/content-safety/how-to/use-blocklist?tabs=windows%2Ccsharp#prerequisites).
193195

194196
```csharp
195197
// This example requires environment variables named "CONTENT_LANGUAGE_KEY" and "CONTENT_LANGUAGE_ENDPOINT"

0 commit comments

Comments
 (0)