Clean up emails from sys_email table

Khanna Ji
Tera Guru

Hi,

I have tested some functionality on Dev and want to enable outgoing emails but there are pilled up emails which should not be sent out.

What is your suggestion? Delete them or change their status to something so they can be ignored? What script background should be used?

 

Can I use below script to prevent sending the emails existing already in the system?

 

var rec = new GlideRecord('sys_email');
rec.addQuery('type','send-ready');
rec.query(); 
while (rec.next()) { 
   rec.type = 'send-ignored';
   rec.update();
}
1 ACCEPTED SOLUTION

Both of the above "processed, send-gnore" is fine. Sytem will only pick sent ready emails for sending out. You can use the code which you shared, it will prevent the emails from sending out. -satheesh

View solution in original post

5 REPLIES 5

Both of the above "processed, send-gnore" is fine. Sytem will only pick sent ready emails for sending out. You can use the code which you shared, it will prevent the emails from sending out. -satheesh