+ if (!$this->allow_rewrite) {
+ global $globals;
+ if (empty($this->hash)) {
+ $this->hash = rand_url_id();
+ XDB::execute("UPDATE emails
+ SET hash = {?}
+ WHERE uid = {?} AND email = {?}", $this->hash, $this->user->id(), $this->email);
+ }
+ $mail = new PlMailer('emails/rewrite-in.mail.tpl');
+ $mail->assign('mail', $this);
+ $mail->assign('user', $this->user);
+ $mail->assign('baseurl', $globals->baseurl);
+ $mail->assign('sitename', $globals->core->sitename);
+ $mail->assign('to', $this->email);
+ $mail->send($this->user->isEmailFormatHtml());
+ }