Genesys CTI User Forum
Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: Reinoud de Lange on May 20, 2009, 04:56:19 AM
-
Hi,
does anybody know how to send an email from an originally voice strategy?
I'm using IRD 7 and ICS 6.5.
I'm trying to send for ex. a standard response after I get a voice call. I want to use the caller's phonenumber and send this by email to a email recipient (not an agent).
Thanks in advance!
-
Not possible with ICS 6.5. You must have an incoming email in order to send an acknowledgment.
But with Multimedia 7.5/7.6 you can create new outgoing email from for example voice strategy. There are separate IRD block Create Email for that.
-
You can't do it with ICS, however you should be able to do it using either a database write and trigger to generate email from SQL Server, or using a web service / custom server call to generate the email.
:)
-
Create a SP in the DB and then invoque it from Genesys, you can pass as parameters some data using SP execution methods.
-
[quote author=cavagnaro link=topic=4222.msg18780#msg18780 date=1242802841]
Create a SP in the DB and then invoque it from Genesys, you can pass as parameters some data using SP execution methods.
[/quote]
Do you have an example for this SP? Do I need something sspecial in my DB? Will this also work from MSDE?
Thanks in advance!
-
I found this on Internet:
[quote]
Declare @resultcode int
EXEC @resultcode = sp_OACreate 'SMTPsvg.Mailer', @oMail OUT
if @resultcode = 0
BEGIN
EXEC @resultcode = sp_OASetProperty @oMail, 'RemoteHost', @mailserver
EXEC @resultcode = sp_OASetProperty @oMail, 'FromName', @SenderName
EXEC @resultcode = sp_OASetProperty @oMail, 'FromAddress', @SenderAddress
EXEC @resultcode = sp_OAMethod @oMail, 'AddRecipient', NULL, @RecipientName, @RecipientAddress
EXEC @resultcode = sp_OASetProperty @oMail, 'Subject', @Subject
EXEC @resultcode = sp_OASetProperty @oMail, 'BodyText', @Body
EXEC @resultcode = sp_OAMethod @oMail, 'SendMail', NULL
EXEC sp_OADestroy @oMail
END
SET nocount off
GO
[/quote]
Forgot to mention that you need to install a little Activex for this to work
http://www.sqlteam.com/article/sending-smtp-mail-using-a-stored-procedure
-
Just an option: SCS alarm reaction could be used.
-
[quote author=cavagnaro link=topic=4222.msg18796#msg18796 date=1242842173]
I found this on Internet:
[quote]
Declare @resultcode int
EXEC @resultcode = sp_OACreate 'SMTPsvg.Mailer', @oMail OUT
if @resultcode = 0
BEGIN
EXEC @resultcode = sp_OASetProperty @oMail, 'RemoteHost', @mailserver
EXEC @resultcode = sp_OASetProperty @oMail, 'FromName', @SenderName
EXEC @resultcode = sp_OASetProperty @oMail, 'FromAddress', @SenderAddress
EXEC @resultcode = sp_OAMethod @oMail, 'AddRecipient', NULL, @RecipientName, @RecipientAddress
EXEC @resultcode = sp_OASetProperty @oMail, 'Subject', @Subject
EXEC @resultcode = sp_OASetProperty @oMail, 'BodyText', @Body
EXEC @resultcode = sp_OAMethod @oMail, 'SendMail', NULL
EXEC sp_OADestroy @oMail
END
SET nocount off
GO
[/quote]
Forgot to mention that you need to install a little Activex for this to work
http://www.sqlteam.com/article/sending-smtp-mail-using-a-stored-procedure
[/quote]
Many thanks!
-
I don't like to install other ActiveX objects and rely on CDONTS (CDONSYS in W2003+) to do this the native style:
[code]
CREATE PROCEDURE [dbo].[sp_send_cdontsmail]
@From varchar(100),
@To varchar(100),
@Subject varchar(100),
@Body varchar(4000),
@CC varchar(100) = null,
@BCC varchar(100) = null
AS
Declare @MailID int
Declare @hr int
EXEC @hr = sp_OACreate 'CDONTS.NewMail', @MailID OUT
EXEC @hr = sp_OASetProperty @MailID, 'From',@From
EXEC @hr = sp_OASetProperty @MailID, 'Body', @Body
EXEC @hr = sp_OASetProperty @MailID, 'BCC',@BCC
EXEC @hr = sp_OASetProperty @MailID, 'CC', @CC
EXEC @hr = sp_OASetProperty @MailID, 'Subject', @Subject
EXEC @hr = sp_OASetProperty @MailID, 'To', @To
EXEC @hr = sp_OAMethod @MailID, 'Send', NULL
EXEC @hr = sp_OADestroy @MailID
[/code]
And then just call this procedure:
[code]
exec sp_send_cdontsmail 'Pavel@Pavelowen.com','Pavel.owen@gmail.com','IMPORTANT MESSAGE','Tony Tillyer is a member of NAMBLA '
[/code]
Works the best for me :)