Page 1 of 1

Using JOB parameters in Email Notification Activity Stage

Posted: Fri Aug 13, 2004 8:21 am
by dwscblr
Hi

How can I use JOB parameters in the Email notification activity stage.
I do not want to hardcode the Recepients Email address in the mail notification activity stage.

Thanks
Sreeja

Posted: Fri Aug 13, 2004 8:37 am
by chulett
Upgrade to 7.5 - that's the first time that parameters are supported in that stage.

What we do is "hard code" email notification groups there. That way we can change who gets the emails without having to touch the jobs.

Or... write your own email routine. :wink:

Posted: Fri Aug 13, 2004 9:48 am
by tonystark622
We use the Routine Activity stage and call a shell script to send the email. The Routine Activity stage supports Job Parameters, but you have to key them in manually, there's no expression builder for this.

FYI, the shell script is a wrapper around the UNIX sendmail command.

Tony

Posted: Fri Aug 13, 2004 10:09 am
by Mike
I'm pretty sure that I've used job parameters in the email notification activity successfully in both versions 6.0 and 7.1. I can't check at the moment to see how I got it to work. I seem to recall that it didn't follow the usual enclosing within #'s. I think I used the parameter as emailSendTo instead of #emailSendTo#.

Mike

Posted: Fri Aug 13, 2004 10:30 am
by tonystark622
I just tested this in v7.1.0 and it didn't work.

I had a Job Parameter called SendToEmailAddy. I put this in the Recipients email address. It sent an email to SendToEmailAddy, not to the email addy in the Job Parameter SendToEmailAddy.

Tony

Posted: Fri Aug 13, 2004 10:48 am
by chulett
Nope, never been there. From the readme for 7.5:

Code: Select all

Job Sequencer 
-------------
A number of enhancements have been made to the Job Sequencer at this
release:

- Additions to Notify Stage
  The Notification Activity can now send attachments. Multiple attachments
  are also supported. All fields may include parameters, except the email
  body.
Unfortunately, it looks like they still haven't added that same ability to the Command Execution stage. :cry: But then I haven't tried it yet...

Posted: Mon Aug 16, 2004 6:56 am
by Mike
The general consensus seems to be that it doesn't work. I was blissfully unaware since I have only tried it on two installations and it has worked on both. I'm positive that I used a job parameter for the email recipient (there is no way that I am going to hard-code my email address into the notification activity stage). I still have access to both installations and can get the details of my sequence job designs tomorrow.

Mike

Posted: Mon Aug 16, 2004 7:24 am
by chulett
You know, sitting here and thinking about it... you may be right. From previous conversations here or on ADN, I think that it did work - but only on one specific platform and that probably by accident. :wink:

What they've finally done is address the issue and made it work across all platforms in the manner you've always assumed it should work.

Posted: Wed Aug 18, 2004 5:47 pm
by Mike
I went back and checked out our email notification setup. As it turns out, we never actually got it working with job parameters in our 6.0 installation.

However, it is working in our 7.1 installation on a Solaris 8 server. We created a job parameter called $emailSendTo as a user-defined environment variable via the administrator client. Within the email notification stage, the recipient address is set to $emailSendTo (no enclosing #'s). At run time, we set the job parameter's value to $PROJDEF. The director log indicates that the email was sent to '$emailSendTo' as if no value substitution occurred, but the email actually goes through just fine.

Glad to hear it is working normally in 7.5. With the quirky behavior observed in our 7.1 installation, I can readily believe that it is purely accidental that it works on the Solaris 8 platform.

Mike

Posted: Fri Aug 20, 2004 12:32 pm
by alokkum
Put proper parameters what you do in jobs, the same way, and compile the sequence. copy the sequence compiled code and paste it in a new server job control script, check for '# #' in the code and remove it manually. Then compile that new server job. and instead of running the sequencer, run this new server job. Hope this helps.
Thanks
Alok

Posted: Fri Aug 20, 2004 4:35 pm
by ketfos
Hi,
Pass these values as parameters in Notification Activity Stage in DS 7.5
and it works

Ketfos