I have a client's ticket system that generates me rather unstructured email alerts on tickets. i have tried several tutorial to parse the email and read certain values out of it but none of them actually did parse the email correctly.
Here are some examples that make the parsing complicated to my understanding:
1) The whole Email is wrapped in a table segment. Nested, we have n tables that represent flex segments such as header, ticket details, description, comments etc. If for some ticket, segments are not filled, they are simply skipped in the mail, thus i cannot access these nested tables by its id, but expect to identify the table that are of interest by a keyword. Sometimes i also need the table segment that follows the one with the keyword.
In this example, i need to look for the table that contains "Defect details" and than take the next table that contains of these details
<table>
<tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'>
<td style='border:solid #A9B2C5 4.5pt;border-top:none;background:white;
padding:7.5pt 7.5pt 7.5pt 7.5pt'>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
style='width:100.0%;mso-cellspacing:0cm;mso-yfti-tbllook:1184;mso-padding-alt:
0cm 0cm 0cm 0cm'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:15.0pt'>
<td style='border:none;border-bottom:dotted #A9B2C5 1.5pt;background:white;
padding:0cm 0cm 0cm 0cm;height:15.0pt'>
<p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;
mso-fareast-font-family:"Times New Roman";color:#724E6D'>Defect Details<o:p></o:p></span></b></p>
</td>
</tr>
<tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes;height:7.5pt'>
<td style='padding:0cm 0cm 0cm 0cm;height:7.5pt'></td>
</tr>
</table>
</div>
<p class=MsoNormal><span style='font-size:18.0pt;font-family:"Arial",sans-serif;
mso-fareast-font-family:"Times New Roman";color:white;display:none;
mso-hide:all'><o:p> </o:p></span></p>
<div align=center>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
2) Within the details segment, we have two columns. Left is always a label, right the value. Again i need to look for a specific label. lets say "Ticket no." to pick the next column here.
I assume i somehow have to create 1) an array of tables, use select to find the item that contains the a key word // or the one next to the one that contains the keyword. One done, i may have to create another array of the nested table to get the value field.
It feels not to far away but i really cant get the actions lined up in the right way here 🙂
Hope i can encourage s.o. to help me here?
Thanks
Thorben

Report
All responses (
Answers (