The Now Platform® Washington DC release is live. Watch now!
‎05-04-2017 03:36 PM
Hi,
I need to turn-on / enable "Email sending enabled" (Email Properties > Email sending enabled) on a non-production instance, but don't want to send emails in the Outbox queue. There are over 1000 emails in Ready state.
What is the most efficient method skipping or ignoring emails in the outbox? Business rule, perhaps. If you can provide a script, I'd greatly appreciate it.
Thanks,
Charlie
‎05-04-2017 03:40 PM
You can create test mailbox and configure this mailbox as outgoing mailbox so that all outgoing mails are sent to this mailbox on non production instance.
Regards,
Sachin
‎05-09-2017 04:24 PM
Hi Charlie,
If you want to quickly get all of the emails in your Outbox to your Skipped mailbox, you can run this script:
var rec = new GlideRecord('sys_email');
rec.addQuery('type','send-ready');
rec.query();
while (rec.next()) {
rec.type = 'send-ignored';
gs.print('Email ' + rec.subject + ' ignored');
rec.update();
}
The Type field determines which mailbox emails are placed in and whether or not the SMTP Sender job picks them up.
It's also always a good idea to set the glide.email.test.user property on your sub-prod instances when enabling email sending.
Regards,
Mike
‎09-05-2018 05:25 AM
Hi Mike,
I've used your script it cleaned my outbox but all new emails also have the status ignored do you know why?
Is the script working in the background? How to fix it?
‎05-09-2017 06:49 PM