Email template / text macro questions

Ok, I believe I was able to sort this out.

For anyone else who needs it. I followed this originally to get where I was at the beginning of the thread: https://community.skuid.com/t/skuid-page-for-send-an-email

Once I got there I wanted to set a default value based on pre-defined text. As Matt pointed out above it was tricky, so I’ve basically done this:


To send the email I open a popup, so I added a javascript snippet action that runs prior to opening up the popup.

var field = arguments[0];
var value = arguments[1];

var template = ‘Say hello to

multi-line

strings!’;

var model = skuid.model.getModel(‘Email’);
var row = model.getFirstRow();
model.updateRow(row,{Body: template});


The
is important, because if I set the pre-defined value of “Body” in the UI model, it returns as one giant line. Thinking about it as I type this, I could maybe do
inside the pre-defined value, but I know in the future I will want several templates to select  from.

Last thing I need to do is make sure I can use merge fields in the template, but I suspect at most I’ll have to load the case model and just get the values.

Hopefully that helps someone else.