Hello MichaelRLevy,
First off, I'm moving this thread to the Developers forum, where you'll get some more relevant answers.
Instead of doing a direct SQL query to retrieve Contact information, I suggest you instantiate a Contact object, ala:
PHP Code:
require_once('modules/Contacts/Contact.php');
$contact = new Contact();
$contact->retrieve($bean->contact_id); // you now have access to all the Contact information in this object
If you want an Email record attached your Case, you'll need to create it first. The process is similar:
PHP Code:
require_once('modules/Emails/Email.php');
$email = new Email();
$email->case_id = $bean->id;
$email->body = "...";
// etc. etc. etc.
$email->save();
You'll need to check the properties of the Emails module and figure out which fields are required. Last, you'll need to check the code that normally sends Emails and transplant that into your logic hook.
Let me know if you run into any problems! Good luck,
Bookmarks