MDL-13412 Allow callers of email_to_user() to set wordwrap; merged from MOODLE_19_STABLE
authorskodak <skodak>
Sat, 15 Mar 2008 17:04:36 +0000 (17:04 +0000)
committerskodak <skodak>
Sat, 15 Mar 2008 17:04:36 +0000 (17:04 +0000)
lib/moodlelib.php

index d9fb6a0a38271b3ae2936db6f0e76783b75cc47a..c43e8638164440d4eca7735642688079faaeefd1 100644 (file)
@@ -3991,10 +3991,11 @@ function &get_mailer($action='get') {
  * @param string $attachname the name of the file (extension indicates MIME)
  * @param bool $usetrueaddress determines whether $from email address should
  *          be sent out. Will be overruled by user profile setting for maildisplay
+ * @param int $wordwrapwidth custom word wrap width
  * @return bool|string Returns "true" if mail was sent OK, "emailstop" if email
  *          was blocked by user and "false" if there was another sort of error.
  */
-function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $attachment='', $attachname='', $usetrueaddress=true, $replyto='', $replytoname='') {
+function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $attachment='', $attachname='', $usetrueaddress=true, $replyto='', $replytoname='', $wordwrapwidth=79) {
 
     global $CFG, $FULLME;
 
@@ -4062,7 +4063,7 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $a
 
     $mail->AddAddress($user->email, fullname($user) );
 
-    $mail->WordWrap = 79;                               // set word wrap
+    $mail->WordWrap = $wordwrapwidth;                   // set word wrap
 
     if (!empty($from->customheaders)) {                 // Add custom headers
         if (is_array($from->customheaders)) {