send an email from voice strategy

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.

:slight_smile:

Create a SP in the DB and then invoque it from Genesys, you can pass as parameters some data using SP execution methods.

2 Likes

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:

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

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.

1 Like

Many thanks!

2 Likes

I don’t like to install other ActiveX objects and rely on CDONTS (CDONSYS in W2003+) to do this the native style:



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

And then just call this procedure:


exec sp_send_cdontsmail '[email removed]','[email removed]','IMPORTANT MESSAGE','Tony Tillyer is a member of NAMBLA '

Works the best for me :slight_smile: