Email filter - action script generate two duplicate emails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 05:41 AM
Hi Expert,
I defined an email filter to send a bounce-back notification email to incoming email sender which is outside our domain, and move the email to junk folder.
But in the action script, no matter I tried to trigger an event
gs.eventQueue("Notification on Rejection", current, current.user, current.subject);
or create a new record in the sys_email table:
var notify_record = new GlideRecord('sys_email');
notify_record.type = 'send-ready';
notify_record.recipients = current.user;
notify_record.subject = 'The subject of the email goes here.';
notify_record.body = 'HTML content goes here';
notify_record.insert();
The system will always send 2 duplicate emails to email senders outside our domain:
Can anyone provide some help?
Thanks in advance,
Yuanquan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 06:50 AM
From the log table, I can see that the email filter was executed twice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:50 AM
Try adding the initialize method right after you instantiated your GlideRecord, i.e.:
notify_record.initialize();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 06:30 PM
Thanks Laszlo. I tried to add the initialize method but the issue still exists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 01:31 AM - edited 08-24-2023 01:31 AM
Perhaps some of the steps described in this knowledge article can help: