I have written an inbound email service to created records based on custom object. This email service processes replies to the outbound email sent from Salesforce. The outbound email's template and letterhead contains the logos. So when the email service runs it returns the following logos' URLs in the textbody.
From: "[email protected]" Sent: Monday, August 27, 2018 9:35 PM To: Jacks, Roger (VISPL) Subject: [EXT] Sandbox: ** Case #: 1114193
Hi Team,
This is regarding email body validation.
Thanks & Regards, Roger Jacks
ref:_00Dq01Kt0._500q0BJQKJ:ref
How can I remove the image addresses from the TextBody
on the Messaging.inboundEmail
object ? I tried following code but my RegEx expression is not working.
String RegEx = '\\bmy.salesforce.com/servlet/servlet.ImageServer?id=\\b';
Pattern MyPattern = Pattern.compile(RegEx);
Matcher MyMatcher = MyPattern.matcher(email.plainTextBody);
String replacedBody;
if(myMatcher.find()) {
replacedBody = email.plainTextBody.replaceAll(RegEx, '');
}
I'm struggling to develop a RegEx expression. My !dea is to find those 3 instances of the image URLs. The common string among them is .my.salesforce.com/servlet/servlet.ImageServer?id=
.my.salesforce.com/servlet/servlet.ImageServer?id=