groupId)?NULL:group_by_id($thread->groupId); if( !$email ) { $errors[] = no_field("form.field.email"); } else if( !is_valid_email($email)) { $errors[] = wrong_field("form.field.email"); } if( count($errors) > 0 ) { $page['formemail'] = $email; $page['ct.chatThreadId'] = $thread->id; $page['ct.token'] = $thread->lastToken; $page['level'] = ""; setup_logo($group); expand("styles/dialogs", getchatstyle(), "mail.tpl"); exit; } $history = ""; $lastid = -1; $output = get_messages( $threadid,"text",true,$lastid ); foreach( $output as $msg ) { $history .= $msg; } $subject = getstring("mail.user.history.subject"); $body = getstring2( "mail.user.history.body", array($thread->userName, $history, Settings::get('title'), Settings::get('hosturl')) ); webim_mail($email, $webim_mailbox, $subject, $body); setup_logo($group); expand("styles/dialogs", getchatstyle(), "mailsent.tpl"); exit; ?>