ALERT! The community will be read-only starting on April 19, 8am Pacific as the migration begins. Read more for important details.
ALERT! The community will be read-only starting on April 19, 8am Pacific as the migration begins.Read more for important details.
Absent Member.
Absent Member.
2530 views

How to generate email notification from schedule

Jump to solution
Is there any way to generate an email notification from schedule?

I look at Notification, there are only the Notification for Incident, Change etc.

There is no notification for schedule.
0 Likes
1 Solution

Accepted Solutions
Fleet Admiral Fleet Admiral
Fleet Admiral
This is an attempt to answer all three of your questions.

(If you're only trying to do one thing, why open three threads?)

There is a RAD application that can be used to send email notifications. It's similar to the message.fc RAD application that is used to send messages to the screen; this one sends out email.

I haven't tried it directly from a schedule record or a javascript, but it does work if called from an SC/SM script, which you can call from the scheduler using the script.execute.bg application.

I assume it can be used right from Javascript in the schedule record; I just haven't tried.


Rad Application: message.email

Parameter Names | Parameter Values
text | $
name | $
types |
prompt | $
boolean1 | true

You'll need to populate the variables - through your script or javascript - but if you send the right parameters, this will send an email.

View solution in original post

18 Replies
Fleet Admiral Fleet Admiral
Fleet Admiral
This is an attempt to answer all three of your questions.

(If you're only trying to do one thing, why open three threads?)

There is a RAD application that can be used to send email notifications. It's similar to the message.fc RAD application that is used to send messages to the screen; this one sends out email.

I haven't tried it directly from a schedule record or a javascript, but it does work if called from an SC/SM script, which you can call from the scheduler using the script.execute.bg application.

I assume it can be used right from Javascript in the schedule record; I just haven't tried.


Rad Application: message.email

Parameter Names | Parameter Values
text | $
name | $
types |
prompt | $
boolean1 | true

You'll need to populate the variables - through your script or javascript - but if you send the right parameters, this will send an email.

View solution in original post

Absent Member.
Absent Member.
Hi Jacob
Thanks, the reason opened three threads was that I found out approach little by little, but always got stuck at some points.

I found another RAD message.bg, is this one can also send email?

Another question is that how to convert the dot in RAD name when we using Javascript?

system.functioins.message.email(arguments)

It seems not correct, also I tried
system.functions.message_email(arguments)

But still wrong.

Any idea on this?
Fleet Admiral Fleet Admiral
Fleet Admiral
Ok, tried this out from Javascript (not schedule, just Script Library for testing) and it works:

-------------------------------------------

var rteReturnCode = new SCDatum

var MessageBody = new SCDatum
MessageBody.setType(8)

var ParamNames = new SCDatum
ParamNames.setType(8)

var ParamVals = new SCDatum
ParamVals.setType(8)

MessageBody.push("Hey what's up?")
MessageBody.push("How's it going?")
MessageBody.push("This is a test email")

ParamNames.push("text")
ParamNames.push("name")
ParamNames.push("types")
ParamNames.push("prompt")
ParamNames.push("boolean1")

ParamVals.push(MessageBody)
ParamVals.push("Jacob.Heubner@nwa.com")
ParamVals.push("n99190")
ParamVals.push("This is only a test")
ParamVals.push(true)

system.functions.rtecall("callrad", rteReturnCode, "message.email", ParamNames, ParamVals, true)
Absent Member.
Absent Member.
The way I did before is use javascript to insert a record directly into schedule table. In schedule part, just use alert to call a notification, that's it. If you need a sample, look at how the SLA breach works.
Consultant
Absent Member.
Absent Member.
Just confirmed, for schedule in application use alert.process, string 1 put the alert name.

Good luck
Consultant
0 Likes
Absent Member.
Absent Member.
Jacob, you are my hero :). I tried your script, it works. Did you figure out how to change the from/reply to in this way? I tried the macro suggestion in another thread, it does not work with SM7.1/SCEmail
Consultant
Absent Member.
Absent Member.
Jacob,
Great script, it works!

I should use rtecall instead of calling the RAD application directly.

Everytime, you can provide what I need. Thanks again!!
Fleet Admiral Fleet Admiral
Fleet Admiral
Try changing this:

ParamVals.push("This is only a test")


to this:

ParamVals.push(["This is only a test","From:somebody@somewhere.com", "Reply-To:somebody@somebody.com"])

I _think_ that will fix the reply-to and from issues.
Fleet Admiral Fleet Admiral
Fleet Admiral
Oop, nope.. that didn't do it.
Fleet Admiral Fleet Admiral
Fleet Admiral
Ok, got it now.

Add the following:

var EmailHeader=new SCDatum
EmailHeader.setType(8)

EmailHeader.push("This is the subject line")
EmailHeader.push("From:someone@somewhere.com")
EmailHeader.push("Reply-To:someone@somewhere.com")


var EmailHeaderRaw = new SCDatum
EmailHeaderRaw = system.functions.strraw(EmailHeader,"newline")


Then change this:
ParamVals.push(["This is only a test","From:somebody@somewhere.com", "Reply-To:somebody@somebody.com"])

(or if you didn't try my last post, this: ParamVals.push("This is only a test") )

To this:
ParamVals.push(EmailHeaderRaw)


That WILL do it (tried it out to check)


Again, this is just from the Script Library... I haven't tried from a scheduler yet.
Absent Member.
Absent Member.
Hi,

btw.... this callrad rtecall is not supported by HP and they may remove it from binaries (this is a binary function) in a future binary version of SM7.x

But you also could add records to eventout with type "email" with JavaScript, this would also work 🙂

Greetings,

Lars
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.