There is no such built-in possibility, but it is quite possible to arrange it with the help of Workflow:
Target Entity: Note
Trigger Type: After record created
Action: Execute Formula Script
Code:
$parentId = workflow\targetEntity\attribute('parentId'); $parentType = workflow\targetEntity\attribute('parentType'); $parentName = workflow\targetEntity\attribute('parentName'); $noteType = workflow\targetEntity\attribute('type'); $createdByName = workflow\targetEntity\attribute('createdBy.name'); $post = workflow\targetEntity\attribute('post'); $postUrl = string\concatenate('[your-instance-url]/#', $parentType, '/view/', $parentId); $contactId = record\attribute($parentType, $parentId, 'contactId'); $contactEmailAddress = record\attribute('Contact', $contactId, 'emailAddress'); $emailSubject = string\concatenate('Post: ', $parentType, ' ', $parentName); $emailBody = string\concatenate( $createdByName, ' posted on ', $parentType, ' ', $parentName, '.', '\n', '\n', $post, '\n', '\n', 'View: ', $postUrl ); ifThen( $contactId != null && $contactEmailAddress != null && $noteType != 'Create', $emailId = record\create( 'Email', 'to', $contactEmailAddress, 'status', 'Sending', 'subject', $emailSubject, 'body', $emailBody, 'isHtml', false) ); ifThen( $contactId != null && $contactEmailAddress != null && $noteType != 'Create', ext\email\send($emailId) );
Leave a comment: