Contact form email notifications sending in batches rather than when received. Hours after submissio

Michael Legacy asked on February 19, 2020 17:31

So, initially I thought this might be an issue of our client's internal network (as testing was showing us receiving autoresponder messages essentially instantly), but now I am seeing the following in the email queue and am wondering why/how this could be possible?

Image Text

I am getting no send errors in the logs and each form I test manually seems to go through the email queue instantly. Here is the details of the first email in the sequence above (sent at 3:48:33 PM):

Image Text

The user filled out the form at 9:53:00 AM and their email was not sent until almost 6 hours later. Something is not right here. The other in the batch were submitted in the hours between 9 AM and 3:48 PM. We have had the client tell us that it's been up to 24 hours between contact form submission and delivery...

What is going on here?

Correct Answer

Zach Perry answered on February 19, 2020 22:45

Here is my guess, based off having this exact same issue in the last week or so. Since you are using MVC, users are hitting the MVC site and the forms/emails are being inserted into the database, but the scheduled task to send the emails is running from another site - the CMS/Admin/Mother (whatever you want to call it) and that site isn't getting hit so it is going to sleep.

I see 3 options to fix: 1.You can do what Brenden said and set the site to always run 2.Set up an external service to ping the admin site and keep it awake (we already had a service that monitored the uptime of the site, so we just added the admin url) 3.Set something up on the MVC site that pings the admin site - potentially when a form is submitted.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on February 19, 2020 17:38

What are your email settings in Settings > System > Email? Do you have it set to a small batch size?

Does your SMTP provider have limitations as to how many emails you can send over a given timeframe?

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on February 19, 2020 17:51

There is Send queued emails scheduled task. Check the the task settings and the last time it was run

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on February 19, 2020 18:06

Have you tested sending of emails without email queue, but instantly?

The trick might be that sending through email queue is happening with Send queued emails scheduled task. Scheduled task will run only if there are incoming request to the server, meaning if no one visits the site scheduled task won't be executed.

If that's case and there is really low traffic on the site you might need to execute scheduled tasks with Windows service or nhave some kind of heath monitor ping Kentico constantly.

0 votesVote for this answer Mark as a Correct answer

Michael Legacy answered on February 19, 2020 20:13 (last edited on February 19, 2020 20:13)

Hey all, hopefully this screenshot can help answer questions. These are the current email settings and we are using Sendgrid for our SMTP server. Even if there was a limit on SendGrid, I doubt we are hitting it. It looks like we are maybe getting 20-30 submissions a day.

Image Text

The site traffics averages about 50 concurrent users, so I'm not thinking that it's a traffic issue, and our "Send Queued emails" task runs every minute as it's supposed to. I'm stumped.

Should I try turning off Email Queuing?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 19, 2020 20:20

Log into your sendgrid account and look at the statistics on there it could be your sendgrid account needs to be verified or has been blacklisted by some so your reputation score has dropped.

Lastly I'd suggest setting your website so it's running all the time in IIS. Then you can rule out the possibility of it being shut down and not processing tasks.

0 votesVote for this answer Mark as a Correct answer

Michael Legacy answered on February 19, 2020 22:03

Brenden,

We are running on an Azure Web Service.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 19, 2020 22:08

Ok then have you set the App Service to run all the time? It's in the web apps settings/configuration.

2 votesVote for this answer Mark as a Correct answer

Michael Legacy answered on February 20, 2020 16:37

Thank you @Zach and @Brenden. I think that's going to do the trick. We are going to just turn of the queuing of emails and see if that works, then we can go down the "Always on" route on Azure. We wanna avoid costs if we can.

This all makes sense though, no one ever logs in to the production CMS instance since we use a dev/staging/production workflow. I'm assuming that all the emails were getting sent when we deploy via content staging a few times a week.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 20, 2020 16:39

Cost vs. functionality? Pretty tough question to ask.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.