Community Discussions and Support
Template editor

I should have added that I can easily manage without this feature.

Overall the template facility is excellent.

However I raise this issue so it can be fixed in a future release.

<p>I should have added that I can easily manage without this feature.</p><p>Overall the template facility is excellent.</p><p>However I raise this issue so it can be fixed in a future release. </p>

I have set up a template configuration to generate an email around two fields I enter at message submit time.

It is a very impressive feature.

I wanted to add in a variable both to the email keyword header line and to the title  (text prompt in the template editor) on the enter variables screen.

Initially I defined the variable and then entered a second line using SET to create a value for it, at the beginning of my template script.

This worked for the keyword  header but NOT for the title line on the enter variable values screen, which displayed a null value.

I did find a very good workaround; set the default value for the variable at create time. It now displays correctly in both places.

However I wonder if there's a bug here... 

<p>I have set up a template configuration to generate an email around two fields I enter at message submit time.</p><p>It is a very impressive feature.</p><p>I wanted to add in a variable both to the email keyword header line and to the title  (text prompt in the template editor) on the enter variables screen.</p><p>Initially I defined the variable and then entered a second line using SET to create a value for it, at the beginning of my template script.</p><p>This worked for the keyword  header but NOT for the title line on the enter variable values screen, which displayed a null value.</p><p>I did find a very good workaround; set the default value for the variable at create time. It now displays correctly in both places.</p><p>However I wonder if there's a bug here... </p>

I'm sure I'm misunderstanding your use of the word "title" because I understand a line of code in the template script that begins with "Title" simply names the template.  It's not a field to which you can assign a value through a variable.  Perhaps an example of your template code would clear the fog.  Here's one I use for reporting work hours for temporary labor.

Title Temp Labor Hour Reporting
string wedate "" "Week ending date:" 8
string ponum "" "Purchase order number:" 6
string temp1 "" "Employee name:" 25
string hours1 "" "Hours:" 5
string temp2 "" "Employee name:" 25
string hours2 "" "Hours:" 5
string temp3 "" "Employee name:" 25
string hours3 "" "Hours:" 5
set Subject = "Hours for week ending ~vwedate~"
set To = "agency@domain.com"
set reply-to = "me@domain.com"

Body
Good Morning,

Please see below for hours for your temps for week ending: ~vwedate~
Please reference purchase order no. ~vponum~ on your invoice.

   ~vtemp1~     ~vhours1~
   ~vtemp2~     ~vhours2~
   ~vtemp3~     ~vhours3~

Thank you.

I'm sure I'm misunderstanding your use of the word "title" because I understand a line of code in the template script that begins with "Title" simply names the template.  It's not a field to which you can assign a value through a variable.  Perhaps an example of your template code would clear the fog.  Here's one I use for reporting work hours for temporary labor. Title Temp Labor Hour Reporting string wedate "" "Week ending date:" 8 string ponum "" "Purchase order number:" 6 string temp1 "" "Employee name:" 25 string hours1 "" "Hours:" 5 string temp2 "" "Employee name:" 25 string hours2 "" "Hours:" 5 string temp3 "" "Employee name:" 25 string hours3 "" "Hours:" 5 set Subject = "Hours for week ending ~vwedate~" set To = "agency@domain.com" set reply-to = "me@domain.com" Body Good Morning, Please see below for hours for your temps for week ending: ~vwedate~ Please reference purchase order no. ~vponum~ on your invoice.    ~vtemp1~     ~vhours1~    ~vtemp2~     ~vhours2~    ~vtemp3~     ~vhours3~ Thank you.

The confusion is my fault for using the word "Title".
I am referring to the "Add text to the prompt dialog" as a title for my data entry box.
I realise that the Title field is set up by Pegasus.

Your script does not set any user-defined varaiables except by user entry.

Mine had:

string Version "" "" 0
set variable Version = "V1.0"

at the beginning.

This set the value for Version for the Keyword header in the email,
but I also used it in the "Add text to the prompt dialog"; it was the null value there.

Replacing the two lines to define the variable and set a default value (and no other changes):

string Version "v1.0" "" 0

displays the correct value in both the Keyword field and the "Add text to the prompt dialog"

This is a simple workaround and a better script than the original one;
I am curious about why the first setup did not work.
Perhaps "set" is executed after user-defined data entry is completed.

Though I have used Pegasus for a long time, I had not used the templates.
Its a very strong feature.

The confusion is my fault for using the word "Title". I am referring to the "Add text to the prompt dialog" as a title for my data entry box. I realise that the Title field is set up by Pegasus. Your script does not set any user-defined varaiables except by user entry. Mine had: string Version "" "" 0 set variable Version = "V1.0" at the beginning. This set the value for Version for the Keyword header in the email, but I also used it in the "Add text to the prompt dialog"; it was the null value there. Replacing the two lines to define the variable and set a default value (and no other changes): string Version "v1.0" "" 0 displays the correct value in both the Keyword field and the "Add text to the prompt dialog" This is a simple workaround and a better script than the original one; I am curious about why the first setup did not work. Perhaps "set" is executed after user-defined data entry is completed. Though I have used Pegasus for a long time, I had not used the templates. Its a very strong feature.

Rather more serious...

The script line (generated by Pegasus, not manually):

 string Standard "0" "Standard reading (lower): " 5

prompts for the variable Standard at run-time, default 0, max length 5.

However the max length 5 has NO effect at all. Any length is accepted.

Is this a bug?

<p>Rather more serious...</p><p>The script line (generated by Pegasus, not manually):</p><p> string Standard "0" "Standard reading (lower): " 5 </p><p>prompts for the variable Standard at run-time, default 0, max length 5.</p><p>However the max length 5 has NO effect at all. Any length is accepted.</p><p>Is this a bug? </p>

I can duplicate the behavior.  The string length spec was not honored in any of my tests.

I can duplicate the behavior.  The string length spec was not honored in any of my tests.
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft