› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Alert help
Hi Darcy,
The notes are misleading, at least for CL versions 5.8 and 6.0. You can use any email address you like in the FROM field including president@whitehouse.gov.
- Mark Thompson
HealthPartners
I certainly can think of some alerts we should be getting from the White House… but that’s a subject for another time 😉
Thanks!
I like to use the name of the server in the from. For example, quovadx@yourdomain.org. It isn’t a valid email address but I find it useful when going through the alerts in my email. That makes it fairly easy for us to see which are from production and which are from test.
Has anyone pulled message content into an alert? I have a bad message thread where anything going through there, qualifies for a correction. I would like to be able to have that data in the alert. Thanks in advance !
Alerts are not usually related to specific messages. You might be better off using a TPS proc that captures the message content and emails it. At that point you can also decide if you want to KILL, ERROR or CONTINUE the message.
- Mark Thompson
HealthPartners
That sounds like a good idea, except now I need help with a TPS that will send the email… any suggestions?
So the condition is that any message that passes through would mean it is missing the medical record and/or account number, so the email should contain the EVN data of the date time, user, and medical record number, if present. Otherwise, I need something else to id the patient record obscurely… hum…Thanks…
Try tclMail. It has been around for a while. Put the package somewhere in the path like $HCIROOT/tclprocs/lib then run mkpkgindex. I usually set up a procedure in a namespace. At the top of namespace put something like:
package require tclMail
Note: We configure an array (MAIL) here
# Address of mail server
set mail(SERVER) 192.100.19.18
# Address of mail recipents Comma separted if more than one
set toADDRESS “SUPPORT,OTHER”
# Domain of mail server
set mail(DOMAIN) infor.com
# The e-mail user
# Note domain is not required. It will be applied from domain setting
set mail(USER) Cloverleaf
# Set e-mail From:
set mail(FROM) Cloverleaf
# Set the mail subject to something meaningful
set mail(SUBJ) “Error while executing Cloverleaf Procedure”
Then a procedure like:
#########################################################################
# mailTo – Send e-mail
# Call tclMail by setting up array as follows
# Key R/O/C Contents
#
# TO R Mail to Address
# MSG R Mail message
# SUBJ R Mail Subject
# AUTH O Type Authorization Require
# NAME C Login Name
# PASS C Password
# PORT O Mail Port to use (Default 25)
# SERVER R SMTP Server address
# DOMAIN R Mail domain
# USER R Mail address of Authorized user
# FROM O Mail From address (def CLOVERLEAF)
#
# Change array parameters as required.
# It is assumed this routine is called with all needed array elements
# set except for the mail message and TO: address(s)
#
# if more than one TO address send mail for each
#
# The message is passed as a string
#########################################################################
proc mailTo {msg} {
variable procName ;# Procedure name
variable MAILUP ;# Package Error Flag
variable mail ;# The mail array
variable toADDRESS ;# Send to addresese
# If package did not load, do not attempt
if {![lempty $MAILUP]} {
echo n$procName: Cannot send e-mail – $MAILUP
echo Message is: n$msgn
return “”
}
set SKIP 0
set mail(MSG) “$msg”
foreach to [split $toADDRESS ,] {
set mail(TO) $to
# DO NOT SEND MAIL IF TESTING!
if {$SKIP || [string equal $::HciConnName TEST] ||
[string equal -nocase -length 7 $::HciConnName UNNAMED]} {
echo nnSending Mail skipped during testing:n
foreach el [lsort [array names mail]] {echo $el: $mail($el)}
} else {
# If connecting to MS Exchange server, uncomment EHLO
# command and comment the other
#if {[catch {set err [tclMail::SendMail mail]} bad]} {
#set err $bad
#}
if {[catch {set err [tclMail::SendMail mail EHLO]} bad]} {
set err $bad
}
if {![lempty $err]} {
echo n$procName: Error sending mail to: $mail(TO)
echo nMessage is: $msgnnError is: $errn
}
}
}
return “”
}
Oops, forgot to include the package 😕