How to use Perl libraries in the email rules

bewgrosseteteΛογισμικό & κατασκευή λογ/κού

13 Δεκ 2013 (πριν από 3 χρόνια και 5 μήνες)

69 εμφανίσεις


1

13.12.13

How to use Perl libraries in the email rules

How to use Perl libraries in
the
email rules

Knowledge base article

This document will guide you to the
installation
steps to use 3rd
-
party Perl libraries in the email
rules of agenTel. This document is applicable
on
agenTel 6.2.

Contents

Contents

................................
................................
................................
.............

1

Installation

................................
................................
................................
.........

1

Install ActivePerl

................................
................................
................................
...............

1

Settings

................................
................................
................................
...........................

5

System PATH variable
................................
................................
................................
.....

5

Remove the old perl lib

................................
................................
................................
...

5

How to use Perl libraries

................................
................................
....................

5

Example: Auto responder

................................
................................
................................
..

6

Goal

................................
................................
................................
.............................

6

Script

................................
................................
................................
...........................

6

Use the script in an email rule

................................
................................
.........................

6


Installation

Install ActivePerl

To use the
Perl libraries,
you need to install the ActivePerl 5.6 package. It is very
important

to
install the right version.

The agenTel email routing server only supports the Perl version 5.6.

You can find the installation

package
on the Voxtron partner site
(
http://partner.voxtron.com/partner/technical/Tools/ActivePerl%205.6/ActivePerl
-
5.6.1.630
-
MSWin32
-
x86.zip
).

Download and extract the zip file to a temporary folder and run the ActivePerl 5.6.1 build 630
setup. If you get a security warning, just ignore it
.



2

13.12.13

How to use Perl libraries in the email rules


After clicking the
Run

button, a welcome screen appears.



After clicking the
Next >

button, a license agreement

page

appears.


3

13.12.13

How to use Perl libraries in the email rules


Read the license agreement and select accept the terms in the License Agreement. After clicking
the
Next >
button,

the custom setup page appears.




Set the location where the software will be installed and se
lect all the features. After clicking
two
time the
Next >
button,
the setup options page appears.


4

13.12.13

How to use Perl libraries in the email rules


Select the first two options and click on the
Next >

button to go to the next page.



By clicking the
Install
button, the installation will start.


5

13.12.13

How to use Perl libraries in the email rules


Click on the
Finish
to complete the installation.

Settings

System PATH variable

Add the perl library paths to the
system PATH variable. Add
C:
\
perl
\
lib
and
C:
\
perl
\
script
\
lib

to the path variable. If you have installed the perl software in another location, you have to adapt
the paths accordingly.

PATH=C:
\
perl
\
lib;C:
\
perl
\
script
\
li
b

Remove
the
old perl lib

To be sure that you are using the right per
l

libraries, you have to rem
ove the

old

perl56.dll from
the installation folder of the agenTel email routing server.

1.

Stop the Voxtron email routing service

2.

Remove the perl56.dll from the installation folder, by default C:
\
Program
Files
\
Voxtron
\
agenTel60
\
Programs
\

3.

Check the Windows sy
stem32 folder, delete also the perl56.dll if exist.

4.

Start the email routing service

How to use Perl libraries

This section will explain, with the help of an example, how you can create an email rule that uses
Perl libraries.

6

13.12.13

How to use Perl libraries in the email rules

Example
: Auto responder

Goal

If

one sends an email to the contact center, this rule will automatically reply to inform the sender
that his/her request is queued and will be handled by an agent as soon as possible. In the rule, we
will use the perl smtp library to send the email.

Script

Use the following script to automatically send a reply to the sender.

use Net::SMTP;

$smtp

= Net::SMTP
-
>new("127.0.0.1");

$smtp
-
>mail($To);

$smtp
-
>to($From);

$smtp
-
>data();

$smtp
-
>datasend("From: $To
\
n");

$smtp
-
>datasend("To: $From
\
n");

$smtp
-
>datasend("Su
bject: Auto
-
reply
\
n");

$smtp
-
>datasend("
\
n");

$smtp
-
>datasend("Dear Customer
\
n");

$smtp
-
>datasend("
\
n");

$smtp
-
>datasend("Thank you for submitting your request.
\
n");

$smtp
-
>datasend("We have queued your request and one of our helpdesk engineers will handle

it
as soon as possible.
\
n");

$smtp
-
>datasend("
\
n");

$smtp
-
>datasend("Best Regards,
\
n");

$smtp
-
>datasend("The Helpdesk");

$smtp
-
>dataend();

$smtp
-
>quit;

$Valid = 1;

Replace the IP address “127.0.0.1” with the one of you smtp server.
The rules uses the
$From and
$To email addresses from the original incoming email.

Use the script in an email rule

Add rule

Open the agenTel configuration client interface, go to E
-
mail routing | Rules and click the
Add
button to add a new rule.

7

13.12.13

How to use Perl libraries in the email rules


Give a name and select free

expression as type of the email rule, click on the
Next…
button to go
to the next page in the e
-
mail rule wizard.



Enter the script and click the
Finish
button to add the rule.


8

13.12.13

How to use Perl libraries in the email rules



Auto reply

The customer sends a request to agenTel



When the email is queued the auto responder
rule is applied.

9

13.12.13

How to use Perl libraries in the email rules



The customer receives the auto reply from agenTel.