+ $recipients = array($confirm->address);
+
+ $headers['From'] = mail_notify_from();
+ $headers['To'] = trim($confirm->address);
+ // TRANS: Subject for confirmation e-mail.
+ // TRANS: %s is the StatusNet sitename.
+ $headers['Subject'] = sprintf(_m('Welcome to %s'), $sitename);
+ $headers['Content-Type'] = 'text/html; charset=UTF-8';
+
+ $confirmUrl = common_local_url('register', array('code' => $confirm->code));
+
+ if (empty($title)) {
+ $title = 'confirmemailreg';
+ }
+
+ $confirmTemplate = DocFile::forTitle($title, DocFile::mailPaths());
+
+ $body = $confirmTemplate->toHTML(array('confirmurl' => $confirmUrl));
+
+ mail_send($recipients, $headers, $body);
+ }
+
+ function onEndDocFileForTitle($title, $paths, &$filename)
+ {
+ if ($title == 'confirmemailreg' && empty($filename)) {
+ $filename = dirname(__FILE__).'/mail-src/'.$title;
+ return false;
+ }