adTempus 4.6 How to?

YoungM01 (10 posts)
March 13, 2020 12:33 PM
Accepted Answer

Does anyone know of a way to set the recipients of an emailed Notification Step at runtime?  I have a job producing multiple output files, each of which needs to be sent to a different recipient.

Thanks for any relevant solutions, Mark

Mark Youngers
Bill Staff (599 posts)
March 16, 2020 06:45 AM
Accepted Answer

I'm not totally clear on your scenario. Do you know in advance what files get produced and who they need to go to? If so you could add a separate notification task for each file.

In terms of setting the recipient list at runtime, you can do this by configuring the Task with a Job Variable:

1. On the Recipients page of the Notification Task Properties, there's an "Additional Recipients" section. Add a new recipient here and set the e-mail address to a variable token, such as "%RecipientList%".

2. Add a script somewhere before the task runs to set the RecipientList variable to the recipient(s) you want to send to. Separate multiple recipients with a vertical bar ("|"). Example code:

adTempus.JobVariables.Add("RecipientList","some person <[email protected]>|[email protected]|third person <[email protected]>")

Note that you can optionally include a display name.

You can also send notification messages programmatically from a script, using the adTempus.SendNotificationMessage method. Sample code (in VB):

        Dim message As New Notification.NotificationMessage()
        message.Subject="Here is your file"
        message.Message="File is attached"
        message.AddAttachment("c:\test\myfile.txt",Nothing)
        message.AddMailRecipient("someone","[email protected]",MessageRecipientType.To)
        adTempus.SendNotificationMessage(message)

Please clarify your needs if you need more assistance.

 

YoungM01 (10 posts)
March 17, 2020 02:28 PM
Accepted Answer

Bill:

Thanks very good ideas.  What I would ideally like to do is create a Notification Recipients Group for each of the various files we will be delivering, use a Notification Task and plug in the Recipients Group to send to at run time.  I've gotten the %RecipientList% variable to work, but only with a single email destination . . . the pipe delimited list doesn't seem to work for me.

Is there perhaps a sample to access the Notification step in the current job and plug in by name a chosen group?  What I have done so far is add multiple Notification Tasks, one per delivered item with a static Notification Group.  I added a Job Variable Condition to each Notification to decide whether this is the correct delivery step or not for this execution, this cuts way down on the amount of programming, but, makes the job itself harder to maintain.

Thanks again,

Mark Youngers
Bill Staff (599 posts)
March 18, 2020 11:19 AM
Accepted Answer

You're right about the pipe delimiter--something is going wrong there.

There is a way to have the SendNotificationMessage send to a built-on notification recipient (or group) but there also seems to be something not working right there, so we're looking at both problems and should have a fix soon.

While we're at it we're going to make it possible to specify a notification recipient/group name at runtime through a variable. So you could set the "RecipientList" variable to include a mix of email addresses and notification recipient/group names, and it will do notification for both.

Does one of those approaches sound like it will work for you?

Replies are disabled for this topic.