Interrupted Process

I am using the BackgroundJob.Enqueue() command to send out bulk email in my ASP.NET MVC5 project. This works well expect when the process gets interrupted for some reason. Then the process starts all over again so some students are getting multiple emails. Is there a way to begin the interrupted process from where it left off instead of at the beginning?

You have to handle that yourself, Hangfire doesn’t know what your method is doing. You have to make your method reentrant : https://docs.hangfire.io/en/latest/best-practices.html#make-your-background-methods-reentrant

You need to put a system in place in your method like this

if(!HasReceivedEmail(student))
{
    SendEmail(student);
}