Can subject be rewritten via regexp?
Posted: 15 May 2018, 17:17
Bear with me please...we the developers have revolted against management, and implemented Mantis as our bug tracking system. Management has the helpdesk/network folks using some cr@ppy expen$ive system from Remedyforce. Did I say it was cr@ppy? Well, Mantis is WAY better in every respect. Anyway, the concession was that we make it "talk" to Remedyforce. Ugh. So I set up the EmailReporting plugin and have Remedyforce send an email to our special SMTP account that Mantis monitors every time a new ticket is placed in the Developer queue in Remedyforce.
It works great. So now my question: I'm not a php coder (but can probably figure it out), which file would be best for me to modify in the EmailTReporting plugin, in order to do a regexp search of the incoming email "Subject" line looking for specific text, and REPLACE that text with something slightly different, before it gets processed by Mantis which sends we the developers a "new incident" notification email? An example:
Subject line of email that Mantis finally throws to us after processing a forwarded email from Remedyforce:
And I need to add code that looks for Incident # followed by a long number, and REPLACE it in the subject line of that message with (REF:IN:nnnnnnnnnn) where the n's are the same number, everything surrounded with parentheses. So for the above example, I need it to end up in the Subject line, PRIOR TO BEING PROCESSED BY MANTIS to look like this:
Make sense? Which file in the EmailReporting plugin would best allow me to accomplish this? I don't mind getting dirty and learning php, etc, I just would like a little head start help.
Thanks!
It works great. So now my question: I'm not a php coder (but can probably figure it out), which file would be best for me to modify in the EmailTReporting plugin, in order to do a regexp search of the incoming email "Subject" line looking for specific text, and REPLACE that text with something slightly different, before it gets processed by Mantis which sends we the developers a "new incident" notification email? An example:
Subject line of email that Mantis finally throws to us after processing a forwarded email from Remedyforce:
Code: Select all
[Emailed_Tickets 0000610]: Incident #00028327 Is now Assigned to Developers Queue
Code: Select all
[Emailed_Tickets 0000610]: (REF:IN:00028327) Is now Assigned to Developers Queue
Thanks!