Home
TeamSite
Email From Workflow
System
I have been mucking through the Perl code trying to solve this issue but I would like to see if anyone else knows how to do this (or if it is possible).
We currently run TeamSite 5.5.2.1 on AIX 5.1.0.0. I inherited this from someone who decided to leave the company so here I am trying to work through a list of things that were not yet done.
We currently have a Workflow set up that emails "Mailbox A" when a document from Human Resources needs to be reviewed by the Big Dog that has the final say-so and actually does the posting for HR.
We are looking at bringing on a group in Legal that would require a different Big Dog for Legal and I've set up the Workflow for this group by copying the HR Workflow and editing the necessary pieces to get it to recognize and select the Legal Workflow.
When a user in HR or Legal submits a file they get two radio buttons on the Submit screen that read "Submit to HR" and "Submit to Legal". The "Submit to HR" emails Mailbox A and they get the notification. However, the "Submit to Legal" is also going to Mailbox A instead of Mailbox B. I have looked through the code to attempt to find where to specify which mailbox gets the email based on the submit selection but am coming up with nothing. I have looked at this and look at this and now my brain is mush. Has anyone else ran into this or have a solution?
Thanks in advance.
Gary
Find more posts tagged with
Comments
NathansDIS
Are you using an external task to send email? I would check the workfllow local variables to see if the email address for group A is specified somewhere. Ours has something like this in the workflow:
<externaltask name="Email_Review"
owner="__TAG__('iw_user');"
description="Send Email"
start="t">
<areavpath v="__TAG__('iw_workarea');"/>
<successors>
<successorset description="Review">
<succ v="Review"/>
</successorset>
</successors>
__INSERT__("<command v='$perl_cmd $mail_cmd -t $review_email' />");
<template_script><![CDATA[
if (
@submit_file
!= 0)
{
__INSERT__("<files>\n");
for (my $i=0; $i <
@submit_file
; ++$i)
{
__INSERT__("
<file path='$submit_file[$i]' " .
"comment='__TAG__(File_comment_$i);'/>");
}
__INSERT__("</files>\n");
}
]]></template_script>
</externaltask>
Adam Stoller
It helps to know what script you're using to send email (an Interwoven script [which one] - or home-grown) and, as Nathan indicated, it would help to see the task definition where you call the script.
If the script is home-grown, you'd have to post it for any of us to help you - and even then ...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
We are indeed using what appears to be an external task to send the email.
Here is code that we are using to email the reviewer...it looks very similar to yours:
<externaltask name="Email_Reviewer" owner="ts-admin" description="Send email to reviewer">
<areavpath v="__TAG__('iw_workarea');"/>
<successors>
<successorset description="Review Files">
<succ v="Reviewer_Review"/>
</successorset>
</successors>
__INSERT__("<command v='$iwhome/iw-perl/bin/iwperl $iwhome/custom/LowesNet/iw_lowesnet_mail_test.ipl Reviewer_Review'/>");
</externaltask>
I have checked the "iw_lowesnet_mail_test.ipl" and I can see in there where the code is constructing the email. That piece of code is listed below. In it I see where the "To" field is specified with the variable for "recipients" but the code that I have copied in below is the only place that "recipients" is referenced and I sure don't see how this thing knows where to send the email.
##------------------------------------------------------------------------------
#Email specific information
##
my $taskowner_email = convert_email($this_task->GetOwner());
my
@recipients
= ();
# if only the owner is to be emailed add him or her to the recipients array
if ($target_task->GetType() eq "usertask") {
push(
@recipients
, convert_email($target_task->GetOwner()));
}
# if the reviews are to be emailed add them to the recipients array.
elsif($target_task->GetType() eq "grouptask" && $taskname =~ m|Reviewer| ){
my $reviewers = &getVariable("$wfid", "reviewers");
foreach (split(/,/, $reviewers)) {
push(
@recipients
, convert_email($_));
}
}
# if the super users are to be emailed add them to the recipients array.
elsif($target_task->GetType() eq "grouptask" && $taskname =~ m|Super| ){
my $supers = &getVariable("$wfid","supers");
foreach (split(/,/, $supers)) {
push(
@recipients
, convert_email($_));
}
}
@recipients
= removeDups(
@recipients)
;
debug("recipient_email =
@recipients\n")
;
debug("taskowner_email = $taskowner_email\n");
##------------------------------------------------------------------------------
# Construct the email
##
my $mailer = new Mail::Mailer('smtp', Server => $mailserver);
my %headers = (
'To' => \
@recipients
,
'From' => $taskowner_email,
'Subject' => "TeamSite Task Notification",
'Mime-Version' => '1.0',
'Content-Type' => 'text/html; charset=ISO-8859-1'
);
JonathonG
A bit of a guess, but it appears from the naming conventions in this line:
my $reviewers = &getVariable("$wfid", "reviewers");
that there is a workflow/job level variable called "reviewers" that contains the name of the email to send. Look in your wft for any sections that say <variable....>. Look to see what XML tag is their parent. I'm guessing you'll find some that are directly under the <workflow> tag, and one of them is "reviewers". You'd want to change the value for that variable based on the user's selection.
Jonathon
Interwoven Developer
Allstate, Inc.
NathansDIS
Good point. You might even search workflow for the email address that is currently getting the email and change it. -n