Inbound action doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2024 08:15 AM - edited ‎07-26-2024 08:20 AM
Hi,
I'm doing an inbound action which, if the word 'salesapp' is present in the subject, creates a record for me in the Custom table. But the inbound action doesn't really start. I flagged the 'stop processing' field because I had read that there was a conflict with the incident table. But even if I flag the field it doesn't work.
this my script :
(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
gs.info('test Inbound action');
var gr = new GlideRecord('sn_customerservice_supporto');
gr.initialize();
gr.u_ambito = "support_other_channels";
gr.contact_type = "Email";
gr.u_typology = "sales_app";
gr.category = 22;
gr.subcategory = "Richiesta Supporto";
gr.short_description = email.subject;
gr.description = email.body;
var cfCliente = email.body.match(/CF Cliente:\s*(.*)/)[1];
var customer = new GlideRecord('customer_account');
if (customer.get('u_tax_reg_id', cfCliente)) {
gr.account = customer.sys_id;
}
gr.insert();
var emailRicontatto = email.body.match(/Indirizzo email per ricontatto:\s*(.*)/)[1];
if (emailRicontatto) {
gr.u_indirizzo_email_di_contatto = emailRicontatto;
gr.update();
}
})(current, event, email, logger, classifier);
the email I receive:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2024 01:15 PM - edited ‎07-26-2024 01:15 PM
I believe your issue is related to the email you are sending being a Forward email rather than New that is indicated in the Email Action. Try changing the Type field to 'Forward' and try to to reprocess it.
