基于Azure与.NET实现事件触发的工作日延迟邮件通知方案咨询
Solution for Scheduled Working-Day Email Notifications
Recommended Azure Logic Apps Trigger & Workflow
The best trigger to connect your .NET event to Logic Apps is the HTTP Trigger. Here's a step-by-step workflow that meets your requirements:
Workflow Breakdown
Initiate from .NET:
When your .NET app generates the event, send a POST request to the Logic Apps HTTP trigger endpoint. Include critical data in the request body:- The event's exact timestamp (
EventDateTime) - Recipient info
- Any content needed for the email notifications
- The event's exact timestamp (
Immediate Notification:
Right after the trigger fires, add an HTTP action to call your .NET email API—this sends the first immediate email.5-Working-Day Delay & Notification:
- Use Logic Apps'
addWorkdaysfunction to compute the target time 5 business days post-event:addWorkdays(triggerBody()?['EventDateTime'], 5) - Add a Delay Until action set to this calculated time. Once the delay elapses, call your .NET email API again for the second notification.
- Use Logic Apps'
15-Working-Day Delay & Notification:
- Repeat the calculation for 15 working days:
addWorkdays(triggerBody()?['EventDateTime'], 15) - Add another Delay Until action, then call your email API a third time to send the final notification.
- Repeat the calculation for 15 working days:
Critical Details
- Working Day Logic: The
addWorkdaysfunction automatically skips weekends. If you need to exclude public holidays, extend the workflow with a custom holiday list (e.g., stored in Azure Table Storage) and use theisHolidayfunction to adjust the target dates. - Reliability: Logic Apps handles delays durably—even if the workflow is interrupted, it will pick up where it left off at the scheduled time.
- Error Handling: Wrap email API calls in a Scope action with retry policies to handle transient failures (like network issues) and ensure notifications are sent.
Alternative Optimized Approach
If you want to simplify things, you can skip calling your .NET email API entirely:
- Use Logic Apps' native email actions (e.g., Office 365 Outlook, Gmail) to send notifications directly from the workflow.
- Store event data in Azure Storage or SQL DB if you need to track notification statuses or reprocess events later.
内容的提问来源于stack exchange,提问作者Manognya
相关产品推荐
相关产品推荐

