Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N
http://test.com/myscript.php?dispo=--A--dispo--B--&recording_filename=--A--recording_filename--B--&lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&pass=--A--pass--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&rank=--A--rank--B--&owner=--A--owner--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
//Written by Drew Gilkey. 2/24/2012
//Syntax:
//Lead Disposition emailer
//Description:
//Emails information provided from VICIDIAL based on disposition.
//VICIDIAL is a Open Source Asterisk Based call center solution. Visit them on http://www.vicidial.org
//License:
//AGPLv2
set_time_limit(0);
date_default_timezone_set('America/Los_Angeles');
function emailinfo($agent, $location, $lead, $phone, $customer, $addinfo = "NA", $error_message = "Log was not sent" , $success_message = "Log was sent",$emailtouse = "test@test.com" )
{
$owner_email = $emailtouse;
$headers = 'From:' . $emailtouse;
$subject = 'Agent: ' . $agent . ' ' . $location;
$messageBody = "";
$messageBody .= 'Agent: ' . $agent . ' ' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Lead: ' . $lead . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Phone Number: ' . $phone . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Where was the action made: ' . $location . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Customer: ' . $customer . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Additional information: ' . $addinfo . "" . "\n";
try{
if(!mail($owner_email, $subject, $messageBody, $headers)){
throw new Exception($error_message);
}else{
echo $success_message;
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
}
$user_id = $_REQUEST['user'];
// $location = $WEB_SERVER . $WEB_PATH .
$status = $_REQUEST['dispo'];
$lead_id = $_REQUEST['lead_id'];
$phone_number = $_REQUEST['phone_number'];
$filename = $_REQUEST['recording_filename'];
$customername = $_REQUEST['first_name'] . " " . $_REQUEST['last_name'];
if($status == "SOLD")
{
emailinfo($_REQUEST['user'], "CallCenter1", $lead_id, $phone_number, $customername , " ", " ", " ", "testemail@destination.com");
//You can also add code here to do something else like store the lead information into another database or table.
}
?>
Acidshock wrote:A couple people PM'd me asking for examples so here is a modified and very much simplified version of a script I use. I put the url for it in the DispoCall URL option under the campaign. The URL looks like this:
...
function emailinfo($agent, $location, $lead, $phone, $customer, $addinfo = "NA", $error_message = "Log was not sent" , $success_message = "Log was sent",$emailtouse = "test@test.com" )
{
$owner_email = $emailtouse;
$headers = 'From:' . $emailtouse;
$subject = 'Agent: ' . $agent . ' ' . $location;
$messageBody = "";
$messageBody .= 'Agent: ' . $agent . ' ' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Lead: ' . $lead . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Phone Number: ' . $phone . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Where was the action made: ' . $location . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Customer: ' . $customer . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Additional information: ' . $addinfo . "" . "\n";
function emailinfo($agent, $location, $lead, $phone, $customer, $addinfo = "NA", $error_message = "Log was not sent" , $success_message = "Log was sent",$emailtouse = "test@test.com" )
{
$owner_email = $emailtouse;
$headers = 'From:' . $emailtouse;
$subject = 'Agent: ' . $agent . ' ' . $location;
$messageBody = "";
$messageBody .= 'Agent: ' . $agent . ' ' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Lead: ' . $lead . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Phone Number: ' . $phone . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Where was the action made: ' . $location . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Customer: ' . $customer . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Additional information: ' . $addinfo . "" . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Campaign: ' . $_REQUEST['campaign'] . "" . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Address: ' . $_REQUEST['address1'] . "" . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'City: ' . $_REQUEST['city'] . "" . "\n";
Re: Email sending after Call
by gardo » Thu Jan 24, 2013 4:18 am
A cron job doing all those can do the trick. Send the email with the sales recording attached to it. 15 minute interval can be a good starting point. By default the recordings are mixed (and FTPed) every 5 minutes.
if($_REQUEST['dispo'] == "Service")
{
THE EMAIL SENDING CODE GOES HERE
}
if($_REQUEST['dispo'] == "SERVICE")
{
function emailinfo($agent, $location, $lead, $phone, $customer, $addinfo = "NA", $error_message = "Log was not sent" , $success_message = "Log was sent",$emailtouse = "test@test.com" );
{
$owner_email = $emailtouse;
$headers = 'From:' . $emailtouse;
$subject = 'Agent: ' . $agent . ' ' . $location;
$messageBody = "";
$messageBody .= 'Agent: ' . $agent . ' ' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Lead: ' . $lead . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Phone Number: ' . $phone . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Where was the action made: ' . $location . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Customer: ' . $customer . '' . "\n";
$messageBody .= '' . "\n";
$messageBody .= 'Additional information: ' . $addinfo . "" . "\n";
try{
if(!mail($owner_email, $subject, $messageBody, $headers)){
throw new Exception($error_message);
}else{
echo $success_message;
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
}
$user_id = $_REQUEST['user'];
// $location = $WEB_SERVER . $WEB_PATH .
$status = $_REQUEST['dispo'];
$lead_id = $_REQUEST['lead_id'];
$phone_number = $_REQUEST['phone_number'];
$filename = $_REQUEST['recording_filename'];
$customername = $_REQUEST['first_name'] . " " . $_REQUEST['last_name'];
}
oshonubi wrote:Hi William,
Thanks for the response. Kindly help some information.
1. Where does the script need to be be, the http folder, agc folder or any folder
2. Does the script need a mail client or its acting as a mail client
3. Where is the configuration of the mail client done pointing it to the mail server.
oshonubi wrote:Hi William,
Thanks for the response. Kindly help some information.
1. Where does the script need to be be, the http folder, agc folder or any folder
2. Does the script need a mail client or its acting as a mail client
3. Where is the configuration of the mail client done pointing it to the mail server.
Users browsing this forum: No registered users and 8 guests