Skip to content

Commit

Permalink
Updating api project
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanchezcr committed Nov 9, 2023
1 parent 99f168b commit a1f98bc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
6 changes: 3 additions & 3 deletions api/SendEmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public static async Task<IActionResult> Run(
string message = req.Query["message"];
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
dynamic data = JsonConvert.DeserializeObject(requestBody);
name = name ?? data?.name;
email = email ?? data?.email;
message = message ?? data?.message;
name ??= data?.name;
email ??= data?.email;
message ??= data?.message;
var emailClient = new EmailClient(Environment.GetEnvironmentVariable("AZURE_COMMUNICATION_SERVICES_CONNECTION_STRING"));
try
{
Expand Down
38 changes: 18 additions & 20 deletions api/api.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<ApplicationInsightsResourceId>/subscriptions/bd3ab3e9-938d-42d8-832f-392ce5e24d51/resourceGroups/dsanchezcr/providers/microsoft.insights/components/dsanchezcr</ApplicationInsightsResourceId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Communication.Email" Version="1.0.1" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.21.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Communication.Email" Version="1.0.1" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.21.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

0 comments on commit a1f98bc

Please sign in to comment.