Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Formatting of message in email action
-
How do you put a carriage return / line feed character into a variable?
I would like to send out an email listing the components that have been deployed (not all components are in each release), eg:
This release consists of:
- Client 1.1.1.1
- Server 1.1.1.2
- etc
I populate a variable for each item that I deploy, eg:
CLIENT_MSG = * Server configuration build
And set the message body as follows:
This release consists of:%CLIENT_MSG% %SERVER_MSG% %CONFIG_MSG% %DATABASE_MSG%
Unfortunately the
<br>
is not valid. I could just put each variable on a separate line but I would end up with a empty lines for those components not included... Not a big deal but if there is an easy way to get around this.
-
In addition, any ideas how to converting a link with spaces to a proper hyperlinked text in a email:
eg
\dwdcw-cofp01\Release\PowerBuilder 12.5\CusMod\Version %CLIENT_VERSION%puts in a link up to the first space \dwdcw-cofp01\Release\PowerBuilder
I've tried surrounding in quotes and using %20 and + to replace the space character but haven't had any success with those.
-
How do I set up an empty variable?
eg If I use set variable action on variable that doesn't exist as follows:
MSG = %MSG% Client version = %CLIENT_VERSION%
I will end up with a string like:
%MSG% Client...
Note the unwanted %MSG% at the beginning.
-
There's no way to set an empty value because it's going to inherit the default value (which also could not be empty) - you would need a custom variable for that unless you used some trickery, e.g. if the email is HTML email, set the value to
<!-- empty -->
or something like that.That being said, it might be easier to write a custom notifier if this email is to be sent after the execution completes. We can send you example code for some of the current notifiers if you're interested in that.
As for the URL issue, try putting file:// in front of the URL and use %20 for spaces (which would be %%20 when escaped for the variable engine, e.g.:
file://\\dwdcw-cofp01\Release\PowerBuilder%%2012.5\CusMod\Version%%20%CLIENT_VERSION%
-
Is there any way to insert a carriage return into a variable?
-
Variables themselves can contain any string value, but the "Set Variable Value" action editor is only a single-line text box.
You could create a new Set Variable Value action ("Set Multiline Variable Value" or something) that has a multi-line text editor, and behaves exactly the same way.
-
I've created a few extensions now so quite comfortable with that, but rather than create from scratch is there anyway to inherit off the current variable setter and override to change the editor to multi-line?
-
The editors/extensions are sealed, so unfortunately the only pattern available at this time is the "Inherits by Clipboard" pattern.
In this case it shouldn't be so bad, since it's a couple-line action+editor.