Velocity email script split string
Hi,
I have the following code which looks up a field in Marketo and pulls through the content, but I have an issue I am trying to start a new row when a certain delimiter "Part" pops up within the content:
#if(!$lead.First_5_Lines_in_Basket__c.isEmpty())
#set($First_5_Lines_in_Basket__c = $lead.First_5_Lines_in_Basket__c)
#foreach($fivelines in $First_5_Lines_in_Basket__c.split("\n"))
$fivelines
#end
#end
The content pulling through is for example -
Part - 7984219, P2220 Oscilloscope Probe, Passive, 300 V Qty. - 11 Part - 2497216, ATREB215-XPRO - Expansion Board, AT86RF215 2.4GHz/Sub 1GHz Multi-Band Transceiver, IEEE 802.15.4/4g Compliant Qty. - 3
But would like it to split to next row when "Part" comes up within the content, so should look like as follows:
Part - 7984219, P2220 Oscilloscope Probe, Passive, 300 V Qty. - 11
Part - 2497216, ATREB215-XPRO - Expansion Board, AT86RF215 2.4GHz/Sub 1GHz Multi-Band Transceiver, IEEE 802.15.4/4g Compliant Qty. - 3
Any help would be appreciated.
Thanks