Imbed Computer Name in a Email Notification Service email

Haven’t done this successfully yet. Maybe I am having a brain fart?

The task I’ve shown attempts to send email in both simple “mailx” command from the endpoint itself in bash script as well as leveraging the Email Notification Service. What I want is addressing which Computer the task has run against/failed on/ whatever may be the case, but the framework for Email Notifications doesn’t seem to evaluate the relevance the way I would like.

parameter "createFilePath" = "{(client folder of current site as string) & "/__createfile"}"

delete __createfile

createfile until CREATEFILE_DONE
#!/bin/sh

echo "{computer name}" | mailx -s "BigFix Patching - $(hostname)" <me>@<mycompany>.com


CREATEFILE_DONE

wait chmod 555 {parameter "createFilePath"}
wait {parameter "createFilePath"}
parameter "ExitCode" = "{exit code of action}"

if {parameter "ExitCode" as string != "0"}
    exit {parameter "ExitCode"} 
endif

// Enter your action script here
// NOTIFICATION_START
// to: "<me>@<mycompany>.com"
// from: "bigfix@<mycompany>.com"
// subject: "RHEL Patching has started on {computer name}"
// body: "The baseline '{actionName}' with ID {actionId} has initiated against {computer name}"
// NOTIFICATION_END 

Wtih what I’ve shown here, although the same relevance of {computer name} is used in both email scenarios, it only evaluates properly in the bash example. Does this mean Email Notifications leverage sessions relevance?

Thanks!