We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9856
    • 4 Posts
    Hi all,

    Jot does not seem to send headers in email notifications. This is a problem for outlook, as this app does not automatically recognizes charset encoding.

    I could not make it adding
    'Content-Type: text/plain; charset="utf-8"'."\n"
    to the email notification creation in jot.class.inc.php.
    mail($user["email"], $this->config["subject"]["moderate"], $message, "From: ".$modx->config['emailsender']."\r\n"."X-Mailer: Content Manager - PHP/".phpversion(),'Content-Type: text/plain; charset="utf-8"'."\n");


    I did it wrong ??
      • 9856
      • 4 Posts
      OK I made it... the problem was that I defined some headers after
      "X-Mailer: Content Manager - PHP/".phpversion()
      so I just passed it before.

      The solution to get uft-8 notification emails in jot 1.1.2 (I could not make email notifications work in jot 1.1.4) :
           
      $headers .='Content-Type: text/plain; charset="utf-8"'."\n";
      $headers .='Content-Transfer-Encoding: 8bit'; 
      mail($user["email"], $this->config["subject"]["subscribe"], $message, $headers, "From: ".$modx->config['emailsender']."\r\n"."X-Mailer: Content Manager - PHP/".phpversion(),$headers);

      to add after :
      						if ($this->config["user"]["id"] != $subscriptions[$i]["userid"] ) {
      							$user = $this->getUserInfo($subscriptions[$i]["userid"]);
      							$tpl = new CChunkie($this->templates["notify"]);
      							$tpl->AddVar('jot',$this->config);
      							$tpl->AddVar('comment',$comment);
      							$tpl->AddVar('siteurl',"http://".$_SERVER["SERVER_NAME"]);
      							$tpl->AddVar('recipient',$user);
      							$message = $tpl->Render();

      and after :
      			foreach ($moderators as $moderator){
      				$user = $modx->getWebUserInfo($moderator);
      				$tpl = new CChunkie($this->templates["notifymoderator"]);
      				$tpl->AddVar('jot',$this->config);
      				$tpl->AddVar('comment',$comment);
      				$tpl->AddVar('siteurl',"http://".$_SERVER["SERVER_NAME"]);
      				$tpl->AddVar('recipient',$user);
      				$message = $tpl->Render();