Do you have access to the Database that Sugar is installed on and is it MYSQL?
My simple suggestion using PHP is create "thankyou.php" redirect people to that page after the lead form has been submitted.
In the thankyou.php set up something like this.
Please Note: This is very basic method of doing this so anymore suggestions on how to make this better please do so.
This grabs the last submission from Sugar with basic variables and email address from the database.
PHP Code:
<?//// Grab CRM DATA ////
$query = "
SELECT
leads.date_entered
, leads.first_name
, leads.last_name
, leads.phone_mobile
, leads.primary_address_street
, leads.primary_address_city
, leads.primary_address_state
, leads.lead_source
, leads.status
, email_addresses.email_address
FROM
leads
LEFT JOIN leads_cstm
ON (leads.id = leads_cstm.id_c)
LEFT JOIN email_addr_bean_rel
ON (leads.id = email_addr_bean_rel.bean_id)
LEFT JOIN email_addresses
ON (email_addr_bean_rel.email_address_id = email_addresses.id)
WHERE (leads.lead_source = 'PUTLEADSOURCEFORFORMHERE'
AND email_addresses.email_address IS NOT NULL)
GROUP BY email_addresses.email_address having count(*) >= 1
ORDER BY leads.date_entered DESC
LIMIT 0 , 1;
";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$first_name_s = $row['first_name'];
$last_name_s = $row['last_name'];
$mobile_s = $row['phone_mobile'];
$email_s = $row['email_address'];
} ?>
}
Then Send the Email again this is a very basic way of sending emails in PHP I suggest you get this somewhat working then use something like PHP SMTP mailer for a better way of sending email.
http://blog.taragana.com/index.php/archive/how-to-send-mails-using-smtp-server-in-php/
PHP Code:
<?
// multiple recipients
$to = $email_s; // note the comma
// subject
$subject = $first_name_a.' '.$last_name_a.' has a message for you.';
// message
$message = '
<html>
<head>
<head><title>Page title</title></head>
<style>
#tablemargin{ margin-top:10px; width:600px; height:579px; }
body{ margin:0px; padding:0px; font-family:Arial, Helvetica, sans-serif;}
</style>
</head>
<body>
MESSAGE GOES HERE
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: '.$first_name_s.' '.$last_name_s.'<'.$email_s.'>' . "\r\n";
$headers .= 'From: 'YOUR_FIRST_NAME' 'YOUR_LAST_NAME'<'EMAIL_ADDRESS_YOUWISH_TO_SEND_EMAILS_FROM'>' . "\r\n";
$headers .= 'Cc:' . "\r\n";
$headers .= 'Bcc: copy@test.com' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
?>
Hope this helps to get you started. I have clients requested this and this can get very elaborate as long as you are be able to access the database you can do a lot more in terms of what happens after an user enters a form and what happens after the submission.
Bookmarks