} } else { // Save in Draft // Fix forward bug. Thanks Ann if (isset($form->action)) { if ($form->action == EMAIL_FORWARD) { $form->oldmailid = NULL; // Drop mailid on forward } // CONTRIB-702 if ($form->action == EMAIL_REPLY or $form->action == EMAIL_REPLYALL or $form->action == EMAIL_FORWARD) { unset($form->id); // If you don't unset id, save eMail update this record. } } if (!$email->save(isset($form->id) ? $form->id : NULL)) { notify('Don\'t save mail in my draft'); } } if (empty($form->draft)) { $legend = get_string('sendok', 'block_email_list'); } else { $legend = get_string('draftok', 'block_email_list'); } redirect($CFG->wwwroot . '/blocks/email_list/email/index.php?id=' . $courseid, $legend, '4'); } else { print_error('Fatal error when sending or draft mail'); } } } else { // DRAFT integration