" /> Employee Name in Email Alert - Genesys CTI User Forum

Author Topic: Employee Name in Email Alert  (Read 1544 times)

Offline jnjustice

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Employee Name in Email Alert
« on: November 12, 2020, 02:01:19 AM »
Advertisement
Hello,

I have an alert set to trigger when an agent hits a certain duration bon a call and it works fine.

The alert though only includes the employee ID from the CFGObjectID. Is there a way to get the name as it displays from FormatAgentInfo in the Configuration Options and Parameters setup?

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Employee Name in Email Alert
« Reply #1 on: November 12, 2020, 03:58:52 AM »
http://www.sggu.com/smf/index.php?topic=7814.0

Offline jnjustice

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Employee Name in Email Alert
« Reply #2 on: November 12, 2020, 07:28:53 PM »
@cavagnaro I am using the action script here http://www.sggu.com/smf/index.php/topic,2237.msg8605.html#msg8605 and I added the CFGPerson to the thresholdInfo variable but it still comes up empty. Can you clarify what you're referring to there?

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Employee Name in Email Alert
« Reply #3 on: November 12, 2020, 08:10:10 PM »
Well my injustice...
There are several ways to send a mail, as you provided no information I assumed that you were using IRD for it.


Now that you have clarified what you are doing
Threshold is an object, so you can easily print its values and see what it contains. Maybe you can see the information you are looking for in there.


foreach is a good start

Offline jnjustice

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Employee Name in Email Alert
« Reply #4 on: November 13, 2020, 06:06:00 PM »
I am not quite sure how to do that and my access to info is a bit limited besides what is in CCPulse directly but I thought of using IF statements to compare Threshold.CFGObjectID against the employees known ID # (shown as # where the ID # would be and NAME where the name would be) and setting the name based on that. The test seems to go okay but errors out at the end saying:

Error at
Line: 65
Position:8
Error message: Expected End

My full code is below but I am not sure why I am getting that error. I have the End Sub there for SendMail so it should be fine but it is not...

[code]
Dim msgBody
Dim thresholdInfo
Dim receipAddress
Dim empName

if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"

thresholdInfo="StatAlias:"+CStr(Threshold.StatAlias)+vbNewLine+"StatValue:"+CStr(round(Threshold.StatValue/60,2))+vbNewLine+"CFGObjectID:"+CStr(Threshold.CFGObjectID)+vbNewLine+"empName:"+CStr(empName)+vbNewLine

receipAddress="email"

'Call our function with recipient, message, and subject

SendMail receipAddress,msgBody+thresholdInfo,"CCPulse Alarm Notification"

Sub SendMail(recipient,msg,subject)

Dim objOutlook

Dim objOutlookMsg

Set objOutlook = CreateObject( "Outlook.Application" )

Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

objOutlookMsg.To = recipient

objOutlookMsg.Subject = subject

objOutlookMsg.Body = thresholdInfo

objOutlookMsg.Importance = 2

objOutlookMsg.Send

Set objOutlookMsg = Nothing

Set objOutlook = Nothing

End Sub
[/code]

Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: Employee Name in Email Alert
« Reply #5 on: November 14, 2020, 11:22:15 AM »
[quote author=jnjustice link=topic=11894.msg53550#msg53550 date=1605290760]
I am not quite sure how to do that and my access to info is a bit limited besides what is in CCPulse directly but I thought of using IF statements to compare Threshold.CFGObjectID against the employees known ID # (shown as # where the ID # would be and NAME where the name would be) and setting the name based on that. The test seems to go okay but errors out at the end saying:

Error at
Line: 65
Position:8
Error message: Expected End

My full code is below but I am not sure why I am getting that error. I have the End Sub there for SendMail so it should be fine but it is not...

[code]
Dim msgBody
Dim thresholdInfo
Dim receipAddress
Dim empName

if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"

thresholdInfo="StatAlias:"+CStr(Threshold.StatAlias)+vbNewLine+"StatValue:"+CStr(round(Threshold.StatValue/60,2))+vbNewLine+"CFGObjectID:"+CStr(Threshold.CFGObjectID)+vbNewLine+"empName:"+CStr(empName)+vbNewLine

receipAddress="email"

'Call our function with recipient, message, and subject

SendMail receipAddress,msgBody+thresholdInfo,"CCPulse Alarm Notification"

Sub SendMail(recipient,msg,subject)

Dim objOutlook

Dim objOutlookMsg

Set objOutlook = CreateObject( "Outlook.Application" )

Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

objOutlookMsg.To = recipient

objOutlookMsg.Subject = subject

objOutlookMsg.Body = thresholdInfo

objOutlookMsg.Importance = 2

objOutlookMsg.Send

Set objOutlookMsg = Nothing

Set objOutlook = Nothing

End Sub
[/code]
[/quote]

Aren't you missing the END IF? Those "IF's" aren't with a single inline command.

Offline jnjustice

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Employee Name in Email Alert
« Reply #6 on: November 14, 2020, 05:13:32 PM »
oh duh. I had them in there but must have missed it when I was copying/pasting the lines. it's working now which is awesome, thanks!