cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
529
Views
0
Helpful
7
Replies

Is it possible to get more than 1 email variable from an email event? Keep getting errors.

I have set up an email event to trigger a Job action that is supposed to pass email variables to a job.  For some reason, I can only pass 1 variable through the job action Parameters Override section.... ie  <email.subject> or <email.message>.  If I try to put more than one, it bombs out.  I have tried a space, comma, carriage return, quotes, etc... At this point, I would like to see if it is even possible to do this or if I have to try a different technique.

 

7 REPLIES 7
Derrick Au
Enthusiast

Hi Edward,

 

This all depends on data type and how many arguments your script/exe is set up to receive. Can you please verify how this is set up?

 

Thanks,

Derrick Au

Email event --> Job Action with override parameters to launch job, which launches script below and prints to echo.txt for testing.  It will give me %1, but never %2.  Here is the cmd....

 

echo off
SET Number1=%1
SET Number2=%2

echo %Number1% >c:\active\echo.txt
echo %Number2% >>c:\active\echo.txt

:exit

For testing, can you just echo %1, echo %2 in the script and see if the joboutput shows the values ? Does it still only display the value of %1 ?

Did what you said above.  Still only echo of %1.  Override output below:

 

"test 5" "<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Test 6<i><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,sans-serif;color:gray"><o:p></o:p></span></i></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>"

Hi Edward,

 

I ran the script above with the parameters you sent. The first argument is just text without html tags, test 5 so this gets echo correctly and directed to echo.txt. The second argument, however, is the culprit. This message body contains a plethora of html tags, angled brackets, and quotation marks--it's no wonder why the script would error out. Most common error for this type of problem is the syntax of the command is incorrect, or < was unexpected at this time. If you would like to see for yourself, then try running it from the DOS shell. Is it possible for you to use plain ASCII text as an alternative?

Dos Echo Output

This is totally possible however you have to set up what you want correctly

if you are using Tidal 5.3.1 which is what  it looks like

  1. Solution is to use a job group and group variables
  2. Create a Job Group with Group variables up example Var1, Var2
  3. Create a child job to use <Group.Var1>,<Group.Var2>
  4. Create an Job Action and insert the Job Group name,  add runtime user/agent
  5. in parameter default section Notice the default params are Var1=,Var2=
  6. in parameter override Add <Email.Subject> to override section
  7. Create Email Event with your email adapter, set up your Scan for Text (probably want to use message or sender, we'll be using subject for var substitution)
  8. make sure everything is enabled
  9. send an email into account with subject:  Var1=MyVar1,Var2=MyVar1
  10. Job should insert have MyVar1 and MyVar2 as your group variables and the child jobs can utilize

I tested this out and it works... you may encounter problems with Number of Characters or something

Let us know how it turns out

Marc

 

 

Marc

Hi Edward,

 

Add the quotes around the variables in the Parameters section

"<Email.Subject>" "<Email.Message>"

 

In your script, let's remove intermediate variables, and strip quotes

echo %1 %2

echo %~1 > C:\active\echo.txt
echo %~2 >> C:\active\echo.txt

 

BR,

Derrick Au

Content for Community-Ad
This widget could not be displayed.