function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TejashriTejashri 

converting html inbound email into plain text format

Hi,

Can any budy help me in below,

We have one workflow on Case object and there are 2 email alerts on this. 
1st email alert send an email to Supervisor when there is button click(created one boolean filed to do so)
2nd email alert go to Email server: This alert using the email template and this is in format of HTML. So email alert mail goto salesforc server and using Email to sf functilnality it is coming back on the case under activity history. 

Issue here is: One tag added into the email template which convert plain text to HTML format and salesforce doesn't support HTML format. So in activity history record email body is missing. 

How to convert this HTML email to Plain text format.??

Thanks in advance 
NagendraNagendra (Salesforce Developers) 
Hi Tejashree,

May I suggest you please give a try by using parsing method stripHtmlTags(htmlInput) String method:  which should probably do the job for you.

stripHtmlTags(htmlInput):Removes HTML markup from the input string and returns the plain text.

Signature:
public String stripHtmlTags(String htmlInput)

Parameters:
htmlInput
Type: String

Return Value:
Type: String

Example:
String s1 = '<b>hello world</b>';
String s2 = s1.stripHtmlTags();
System.assertEquals(
   'hello world', s2);
Hope this helps.

Thanks,
Nagendra.
 
TejashriTejashri
Thanks Nagendra for reply..

But How can I access my email template in this method ?