I have created a front-end form to facilitate editorial review of user submitted content. I have created a controller action to receive the post.
My question, how do I locate the email address of the author tied to this entry? My objective is to be able to email the author with the results of the editorial review. In order to accomplish this I need to know the user (author) email address etc. Here is my code.
$this->requirePostRequest();
$entryId = craft()->request->getRequiredPost('entryId');
$editorialNotesInternal = craft()->request->getPost('fields.editorialNotesInternal');
$editorialScore = craft()->request->getPost('fields.editorialScore');
$editorialNotes = craft()->request->getPost('fields.editorialNotes');
$sectionId = craft()->request->getPost('sectionId');
$entry = new EntryModel();
$entry->id = $entryId;
$entry->sectionId = $sectionId;
if ( $editorialScore >= 3) {
$entry->enabled = true;
} else {
$entry->enabled = false;
}
$entry->getContent()->editorialScore = $editorialScore;
$entry->getContent()->editorialNotes = $editorialNotes;
$entry->getContent()->editorialNotesInternal = $editorialNotesInternal;
$success = craft()->entries->saveEntry($entry);