# Schedule notification

**URL:** <https://www.virtocommerce.org/t/schedule-notification/748>\
**Category:** dev\
**Created:** [December 4, 2024, 6:27am UTC](https://www.virtocommerce.org/t/schedule-notification/748 "2024-12-04T06:27:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahilgoel156](https://yyz2.discourse-cdn.com/flex032/user_avatar/www.virtocommerce.org/sahilgoel156/32/1435_2.png) [@Sahilgoel156](https://www.virtocommerce.org/u/Sahilgoel156)\
**Post date:** [December 4, 2024, 6:27am UTC](https://www.virtocommerce.org/t/schedule-notification/748/1 "2024-12-04T06:27:51Z")

</div>

Hello Team,

I want to utilize the scheduled notification functionality from the notification module. However, I am unable to identify the fields required to map the date and time. Could you please guide me on how to use this functionality? I noticed there is a method for scheduling notifications, but I can’t seem to find the corresponding implementation.

Thank you.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/virtocommerce/original/2X/5/58e8dc8c4e52926b6daf1dda9b45a7ea3e2dce86.png)

---

<div class="post-metadata">

**Author:** ![tatarincev](https://yyz2.discourse-cdn.com/flex032/user_avatar/www.virtocommerce.org/tatarincev/32/161_2.png) [@tatarincev](https://www.virtocommerce.org/u/tatarincev)\
**Post date:** [December 6, 2024, 8:22am UTC](https://www.virtocommerce.org/t/schedule-notification/748/2 "2024-12-06T08:22:59Z")

</div>

Hello,  
The notification module does not currently support scheduling notifications to be sent at a specific time. It provides two methods for sending notifications:

1. **Synchronous** : `SendNotificationAsync`
2. **Asynchronous** : `ScheduleSendNotificationAsync`

To schedule a notification for a specific date and time, you can use the following code snippet:

```auto
// Schedule the notification to be sent at a specific date and time using Hangfire's BackgroundJob.Schedule method.
BackgroundJob.Schedule(
    () => ScheduleSendNotification(notification), 
    new DateTimeOffset(new DateTime(2024, 12, 31))
);

// Method to handle the notification sending logic.
public async Task ScheduleSendNotification(EmailNotification notification)
{
    // Ensure the notification sender is properly utilized to send the notification asynchronously.
    await _notificationSender.SendNotificationAsync(notification);
}

```

---

<div class="post-metadata">

**Author:** ![Sahilgoel156](https://yyz2.discourse-cdn.com/flex032/user_avatar/www.virtocommerce.org/sahilgoel156/32/1435_2.png) [@Sahilgoel156](https://www.virtocommerce.org/u/Sahilgoel156)\
**Post date:** [December 9, 2024, 10:38am UTC](https://www.virtocommerce.org/t/schedule-notification/748/3 "2024-12-09T10:38:57Z")

</div>

Thank you for the solution.
