More in this section
Forums / Sitefinity SDK / Problem with ScheduledTask

Problem with ScheduledTask

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Jesús
    Jesús avatar
    0 posts
    24 Nov 2016
    11 May 2017
    Link to this post


    I'm using Sitefinity SDK 9.2, I'm trying to create a scheduled task for send a notification to all users of my site. I create the task but never executed. What could be the problem?

    A sample of code that I'm using:

    The ScheduledTask class:

    public class SendWeeklyEmailSummaryTask : ScheduledTask
    // Inject dependencies 

    public SendWeeklyEmailSummaryTask()
    Key = SendWeeklyEmailSummaryTaskKey;

    public static void CreateTask()
    var manager = SchedulingManager.GetManager();
    var title = "SendWeeklyEmailSummaryTask";

    var tasks = manager.GetTaskData().Where(i => i.Title == title);

    foreach (var task in tasks)

    var date = DateTime.UtcNow.Date.AddSeconds(30.0);
    //var nextWeekend = LocalizationService.GetNextWeekend(DateTime.UtcNow.Date, DayOfWeek.Saturday);
    var newTask = new SendWeeklyEmailSummaryTask
    Title = title,
    ExecuteTime = date,
    Enabled = true


    public override void ExecuteTask()
    var notification = new NotificationServiceSnippetWeeklyActivitySummary(UserRepositoryInstance, WidgetServiceInstance, EvemtRepositoryInstance, ExternalUserRepositoryInstance);

    public override string TaskName => "SitefinityWebApp.Tasks.SendWeeklyEmailSummaryTask";

    public static readonly string SendWeeklyEmailSummaryTaskKey = "SendWeeklyEmailSummaryTask";

    I'm register the task at Bootstrapper_Bootstrapped event of Application_Start.

1 posts, 0 answered