are immediately taken into account (Closes #1112)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
}
+ /** Format of the emails sent by the site
+ */
+ public function setEmailFormat($format)
+ {
+ Platal::assert($format == self::FORMAT_HTML || $format == self::FORMAT_TEXT,
+ "Invalid email format \"$format\"");
+ XDB::execute("UPDATE accounts
+ SET email_format = {?}
+ WHERE uid = {?}",
+ $format, $this->uid);
+ $this->email_format = $format;
+ }
+
+
/** Get watch informations
*/
private function fetchWatchData()
if (Post::has('email_format')) {
$fmt = Post::s('email_format');
- XDB::execute("UPDATE accounts
- SET email_format = {?}
- WHERE uid = {?}",
- $fmt, S::v('uid'));
+ S::user()->setEmailFormat($fmt);
S::set('email_format', $fmt);
}