No subject
Fri Jan 25 17:20:55 EST 2008
into the prep code. From what I found on the list, I have put the following
prep code together. But since my Perl skills are zero to null I wanted to
run it by the list:
Prep Code:
my $Trans = $self->TransactionObj;
my $submitted = $Trans->Attachments->First->GetHeader('X-Webform') =~
/^yes\b/ ;
# if the X-webform is yes then do magic
if ( $submitted = yes )
{
return 1;
} else {
return 0;
}
So, for the scrip edit page I currently have this:
Condition: On Create
Action: User Defined
Template: Global template:Blank
Stage: TransactionCreate
Custom condition: BLANK
Custom action prep. code: currently it has "return 1;" but I would like
to add the check
Custom action cleanup code: "My Magic"
So my questions are:
1) Is my logic right - by adding a "return 1 if or return 0" type statement
to the prep condition will I by-pass the cleanup code?
2) Is my prep code noted above "good" or is my lack of Perl showing through?
--
http://gentgeen.homelinux.org
#############################################################
Associate yourself with men of good quality if you esteem
your own reputation; for 'tis better to be alone then in bad
company. - George Washington, Rules of Civility
------=_Part_6355_25133542.1202314370659
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I have a webform that submits an email into RT. I have a scrip that I want to run ONLY if the email came from the webform. I currently have the scrip set up, and all is working - but it works on EVERY email that comes in. I would like to add a check so that if the email came from somewhere other then the web form, then the rest scrip can be by-passed. With my webform, I have added an X-header -- "X-Webform: yes"<br>
<br>From reviewing the archives, It appears as though I can place this check into the prep code. From what I found on the list, I have put the following prep code together. But since my Perl skills are zero to null I wanted to run it by the list:<br>
<br>Prep Code:<br><br> my $Trans = $self->TransactionObj; <br> my $submitted = $Trans->Attachments->First->GetHeader('X-Webform') =~ /^yes\b/ ; <br> # if the X-webform is yes then do magic<br> if ( $submitted = yes )<br>
{ <br> return 1;<br> } else {<br> return 0;<br> }<br><br><br>So, for the scrip edit page I currently have this: <br> Condition: On Create<br> Action: User Defined<br> Template: Global template:Blank<br>
Stage: TransactionCreate<br><br> Custom condition: BLANK<br> Custom action prep. code: currently it has "return 1;" but I would like to add the check<br> Custom action cleanup code: "My Magic"<br clear="all">
<br>So my questions are:<br>1) Is my logic right - by adding a "return 1 if or return 0" type statement to the prep condition will I by-pass the cleanup code?<br>2) Is my prep code noted above "good" or is my lack of Perl showing through?<br>
<br>-- <br><a href="http://gentgeen.homelinux.org">http://gentgeen.homelinux.org</a><br><br>#############################################################<br> Associate yourself with men of good quality if you esteem <br>
your own reputation; for 'tis better to be alone then in bad <br> company. - George Washington, Rules of Civility
------=_Part_6355_25133542.1202314370659--
More information about the RT-Users
mailing list