Fomratting text strings in Zoho Creator

Fomratting text strings in Zoho Creator

Hi

I am developing a small app which will generate emails based on a status field. But i can't figure out how to format different text strings.


At the moment its a big if else if else if else ... construct , and within each condition it has a SendMail and all the appropriate text is formatted within that condition.


It would be much better if i could format a number of strings like emailHeader, emailBody, emailFooter, and then just have one SendMail at the end which sends emailHeader+emailBody+emailFooter.


How can i format string in creator? I cant work out how to define strings. a printf type function or any other way of formatting the text strings would be great.


Heres an example of what my code looks like :


if(input.Repair_Status  ==  "In Queue")
{
 sendmail
 [
  from:zoho.adminuserid
  to:input.Email
  subject:"Device Repair Status for RD" + input.Job_Details_Reference
  message:"Hi&nbsp;\n<div>&nbsp;</div>\n<div>We just wanted to let you know that your device has now entered our repair queue and will be processed in order of allocation.&nbsp;</div>\n<div><br>\nWe will send you a further update when your device repair status changes &amp; we have further information to provide.&nbsp;</div>\n<div><br>\nThanks for choosing us for your device repair, we will be in touch as soon as possible with further details.&nbsp;</div>\n<div><br</div>\n<div><br><br><br>-------<br><b>STATUS</b><br>-------<br><br></div>" + input.Job_Notes
  content type:HTML
 ]
}
else if(input.Repair_Status  ==  "Fault Investigation")
{
 sendmail
 [
  from:zoho.adminuserid
  to:input.Email
  subject:"Device Repair Status for RD" + input.Job_Details_Reference
  message:"Hi&nbsp;\n<div>&nbsp;</div>\n<div>We just wanted to let you know that your device is moving through the system & we are currently investigating the issues you have reported.&nbsp;</div>\n<div><br>\nWe will send you a further update when your device repair status changes &amp; we have further information to provide.&nbsp;</div>\n<div><br>\nThanks for choosing us for your device repair, we will be in touch as soon as possible with further details.&nbsp;</div>\n<div><br>\n</div>\n<div></div>"
  content type:HTML
 ]
}
else if .... (theres a dozen of these)


As you can see its messy, i would to just have one sendmail and construct the subject field from predefined strings. It will make changing the text much easier in the future.


Any help gratefully received .

Thanks