I noticed that we have thousands of lines in emailhistory table where to, cc and bcc columns are empty or contain text null.
How can i clean those away from that table so that email history job will not try to send those over and over again?
Run below query.
update emailhistory set status=2 where status=404 limit 5;
1 - SENDNOW
15 - INPROCESS
404 - ERROR WHILE SEND
Usually 5,15,404 are considered as bad statuses as they would result in filling up emailhistory_archive table with duplicate values. Hence clean up can be done to remove them.
You have a job for this called DefaultArchivalJobTrigger which normally purges emails older than 90 days.
This job had an issue for purging the email table, but it has been fixed in version 23.6.
Have a nice evening,
I have an email in my emailhistory table that was created 4/28/2023 and the Archival Job is not purging it. This is our Dev environment so the email history job does not run on a schedule, but when I run it on demand, this email generates over and over again and actually does get sent.
This environment is 23.9.
Thanks for tips.
When i posted this question we were in sp3.12 which didn't had "Cleanup email history data". And then we updated to sp3.18 which brought that but it is not working in that version.
You can run the following enhanced execution query to set any 'stuck' emails to no longer send. I have no idea how to purge them from the table. It doesn't appear to be an issue to leave them there.
2 as emailhistory__status,
emailhistorykey as emailhistory__primaryKey
status != 2;