Send contact form submissions to Highrise
While adding a few features the back-end of our contact form logic I had an interesting thought; Wouldn't it be nice if these messages not only arrived in our email mailbox, but were also automatically entered into our Highrise account. Highrise is a web-based CRM from 37signals which we use for tracking contacts and project leads.
When the contact form is submitted, we do a little processing (with PHP) and then fire off an email to our contact address as normal. Highrise supports forwarding emails to a 'dropbox' address (more on dropboxes) which will then be imported as a message, creating the original sender as a new contact, or attaching it to an existing one if the email address matches with one of your contacts. All we have to do is add an additional step to reformat the email as a forwarded message, and send it to our dropbox address. Here's the code we use:
$body = "New Contact Form Submission\n\n"; // build message body /***** <snip> ****/ // sanitise email/name $name_safe = mail_header_safe($_POST['contactName']); $email_safe = mail_header_safe($_POST['email']); // send to our contact list mail($contact_addr, 'Contact Form', $body, "From: $contact_addr\r\nReply-to: \"$name_safe\" < $email_safe>\r\n"); // build highrise body $new_body = "\n---------- Forwarded message ----------\n" . $new_body .= "From: \"$name_safe\" < $email_safe>\n\n"; $new_body .= $body; // send to highrise mail($dropbox_addr, 'Fwd: Contact Form', $new_body, "From: $contact_addr");
You will also need to make sure that the from address in these emails ($contact_addr in our code) is registered to a user on your Highrise account, otherwise the message will be discarded by the Highrise importing process. See the Highrise help page for more information on this.
As usual, if you've found this useful or have any improvement please leave a comment!comments powered by Disqus