Hi,
When I create a Case I want to email the related Contact with the Case details and its progress. How do I say in a workflow to sent an Email alert to the realted contact of the case that has triggered the workflow?
Rgds
Chris
Hi,
When I create a Case I want to email the related Contact with the Case details and its progress. How do I say in a workflow to sent an Email alert to the realted contact of the case that has triggered the workflow?
Rgds
Chris
I don't think this can be done by the workflow module.
You will need to create a before_save logic hook on the Case module that does:
- Create a Contact object
- Retrieve the related Contact
- Create an Email object
- Populate the Email object
- Send the Email
Something like:
This is definitively not a complete example but should get you started.PHP Code:require_once "modules/Contacts/Contacts.php";
require_once "modules/Emails/Emails.php";
$contact = new Contact();
$email = new Email();
$contact->retrieve($bean->contact_id);
$email->text = $case->resolution
$email->subject = $bean->case_number . " " . $bean->name;
$email->to_addrs = $contact->EmailAddress->GetPrimaryAddress();
$email->Send();
Use the editLogicHooks tool in my signature to create the logic hook for you if you do not know how.
M
--
Marnus van Niekerk
There are only 10 types of people in the world
those who can read binary and those who don't
Modules:
CE Teams - Upgrade safe teams module for Community Edition
FieldACL - Field Level Access Control for Community Edition
EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
FlexibleChartDashlet - Display any data in a Dashlet Chart
DocumentThumbnails - Thumbnails for Documents module
Many questions can be answered by reading the Developers Manual
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks