Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Workflow input form - pretty emails
tgerber
We are developing a web page to start our publishing workflow. In this web form we have several fields the requestor must fill out.
When done we are concatinating the fields together so they go into the description field of the email and workflow task within Interwoven.
Our biggest pain is getting proper whitespace to show up - carriage return/linefeeds.
We tried HTML syntax and that works in the email but when you look at it in Interwoven you see the BR tag.
We tried just the \r\n values and that doesn't work in the email but does in Interwoven.
Is there some value/tag we can use to get proper white space in our emails and in Interwoven?
Thx
Find more posts tagged with
Comments
Migrateduser
Are you making use of HTML-formatted email? If not, why? If so, can you post your code so someone "here" can help you?
I dislike the ugly emails that TS sends out by default, so I'm often redesigning them -- but, I haven't had an inconsistency issue with them as yet.
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
elumpkin
Disclaimer: I am *extremely* new to TeamSite/Interwoven, and I'm starting with code provided by a Interwoven consultant whom I never interacted with. So I often am unfamiliar with what are 'standard' (normally unaltered) pieces of code and what pieces are commonly 'custom tailored.' As such I apologize for any noobness and thank you in advance for any necessary hand-holding.
Actually getting the email to look correct is proving to be much simpler than getting it to look correct in the teamsite interface. When I concatenated the several input fields from our 'initiate publish request' flow into the single pre-existing job_description field I first placed '\r\n' everwhere I wanted a line break. This didn't work in either the email or the teamsite interface (specifically this URL -->
http://teamsite.fnni.com/iw-cc/command/iw.ccpro.job_details
.) I then tried using the HTML line break tag <br> instead of /r/n and that made the HTML email look correct, but the teamsite interface was converting the line break tag into <BR> so you'd actually see the tag instead of the desired line break.
I'm not sure if I need to create the job_description field in a different manner to get the line breaks working as I want in both the email and the T.S. interface. Or if it is actually necessary to tweak the code for iw.ccpro.job_details.
I've attached the wft file I've been working with. If you search for CREATING JOB DESCRIPTION you'll see where I'm concatenating several input fields together with a separator of <BR> to create my job description.
Migrateduser
Could you also attach a screen shot of the page that's generated from this? It's hard to me to visualize what's displayed.
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
elumpkin
Yes. This is a screenshot of the T.S. interface, with the highlighted text being the specific text I'm concerned with.
Migrateduser
I'm glad you posted that -- I had actually pictured something else entirely. TS is displaying plain text whereas your email is displaying formatted HTML. From what I can see, you have two options:
1. Have different strings for each of the TS job detail frame and email. Your job detail frame would just be a s/<br>/\r\n/g of the email.
-or-
2. Keep the \r\n copy of the string and use it in the email. However, encapsulate your "\r\n"-filled content with <pre> tags so that you have a block of text with <pre> and </pre> around it. This will cause an HTML parser to interpret line breaks as would something that displays plain text.
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
elumpkin
I see where you are going, however I end up with the same thing happening to the <PRE> tags as was happening with the <BR> tags via T.S. See attached...
Migrateduser
Actually, I was thinking you would put the <pre> tag in the email, not in the job description. Is it possible for you to separate the strings? If so, I'd recommend the other option -- that is, preserve the \r\n in one string and preserve the <br> in the other.
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
elumpkin
Now that you say that I'm pretty sure that is something I can do, I just need to delve down into the guts of the email sending process. And once I figure out a way to get the newlines to show via the TeamSite webapp I may find that I *have* to separate the T.S. string from the email string (or at least convert from one to the other.)
At this point I'm thinking the only way to get newlines to display within the job description when viewed through the TeamSite webapp is to make a change to the iw.ccpro.job_details script that generates the web frame/page. Or do you have any different suggestions?
Migrateduser
I haven't ventured there, but seriously, wouldn't it be much less work and not suceptible to upgrade overwrites if you were to carry 2 different strings into that routine?
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
elumpkin
Yes, except if I'm asked to add a new field to both the email and the job description, because in that case I'll need to remember to add it to both. That's why I'm thinking of maybe having a 'converter' for creating the email-friendly string from the TeamSite webapp-friendly string. Then it's only one string, but formatted appropriately for either viewing method. But, frankly, either that or just having two strings as you suggest are pretty similar solutions. However I was avoiding choosing one way or the other until I'd figured out how to get the newlines working correctly when viewing via TeamSite. As that could conceivably have some impact on my decision between the 2 strings vs converter approaches.
Migrateduser
Using HTML:
arser might help you, but if you were to compose the string and
then
do any translations you need to, you're not adding new fields to both strings -- just to the one, before there's a distinction.
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
Adam Stoller
If you can get it to look right when displayed within TeamSite (i.e. in the picture you posted) - it would probably be a relatively trivial regex to convert it for HTML formatting for the email.
I.e. - if
\r\n
works in TeamSite (if not, try just
\n
) - then you could make a regex for your email script to change all newlines in the description to HTML line breaks (e.g.:
(my $desc = $task->GetDescription()) =~ s|\r\n|<br/>|gsm;
)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
tgerber
Ok- we still can't figure out how to make it work. Sorry if we are being dense.
here is our code - how should we change it if you don't mind helping further.
, here’s the WorkFlow code that is generating the Job Description field.
#CREATING JOB DESCRIPTION
my
@file_comments
= ();
my $change_summary = __VALUE__('change_summary');
my $web_site = __VALUE__('web_site');
my $change_detail = __VALUE__('change_detail');
my $required = "";
if ((__VALUE__('req_outage') eq 'true') ||
(__VALUE__('coord_with_db') eq 'true') ||
(__VALUE__('coord_with_ear') eq 'true')) {
$required = "Required: ";
$required .= __VALUE__('req_outage') eq 'true'
? "Outage, " : "";
if ((__VALUE__('coord_with_db') eq 'true') ||
(__VALUE__('coord_with_ear') eq 'true')) {
$required .= "Coordination with ";
my
@coord_ears
= (__ELEM__('coord_ear')
? sort __VALUE__('coord_ear') : ());
my $coords =
join(",",
@coord_ears
,__VALUE__('coord_with_db') eq 'true' ? "DB publish" : ());
$required .= $coords;
}
}
my $separator = "\r\n";
my $due_date = __VALUE__('due_date');
my $due_time = __VALUE__('due_time');
my $job_description = <<EOL
<PRE>
Web Site to Publish: $web_site $separator
Requested publish date/time: $due_date $due_time $separator
$required $separator
Change Summary: $change_summary $separator
Change Detail: $change_detail
</PRE>
EOL
;
Adam Stoller
Are you and elumpkin working together?
You said in your first post that using '\r\n' worked in TeamSite but not in the email.
I said, essentially, "fine - then adjust the code in your email script to replace '\r\n' with '<br>' tags before using it in the email message.
You've now posted code from the wft - not the email script.
If you don't know the difference between the wft and the email script - or - if you don't know how to write a regular expression in the email script to do what was suggested - then there's a significant gap here that you need to fill; either through education/training, or hiring someone to assist you.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com