I added a unique separator (“;”) to the string. This helped me to separate the lines.
Then I did a split function and split the string to an array.
After that I did another split with “:” as separator and only get the right side of the string.
That way I can easily generate my values and I don’t have casing issues in the future. In fact, I don’t even rely on the key because I just read the value.
Edit: I even improved the mechanism further. I do check the key to assign the value of key:value pair to the right variable. Now I am even independent of the order of the key:value pairs in the mailbody.