Emails display as plain text in .icloud clients

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 15, 2014   (RSS)

Hi,

The issue might be that the firstname and lastname fields are accidentally being double encoded, as you're explicitly calling them to be encoded in UTF-8.

Have you tried using the ucword function instead?

// send email to user
$emailTemplate = "email/email_reset_password2.php";
$emailHeaders  = emailTemplate_load(array(
  'template'     => websiteLogin_pluginDir() . "/$emailTemplate",
  'subject'      => '', // set in template
  'from'         => '', // set in template
  'to'           => $user['email'],
  'placeholders' => array(
  'firstname'      => ucwords(strtolower($user['firstname'])),
  'lastname'       => ucwords(strtolower($user['lastname'])),
  'resetUrl'       => $resetQuery,
  ),
));
$mailErrors   = sendMessage($emailHeaders);
if ($mailErrors) { die("Mail Error: $mailErrors"); 
}

You could also try calling the mb_convert_case function without specifying the encoding:

// send email to user
$emailTemplate = "email/email_reset_password2.php";
$emailHeaders  = emailTemplate_load(array(
      'template'     => websiteLogin_pluginDir() . "/$emailTemplate",
      'subject'      => '', // set in template
      'from'         => '', // set in template
      'to'           => $user['email'],
      'placeholders' => array(
      'firstname'      => mb_convert_case($user['firstname'], MB_CASE_TITLE),
      'lastname'       => mb_convert_case($user['lastname'], MB_CASE_TITLE),
      'resetUrl'       => $resetQuery,
      ),
    ));
$mailErrors   = sendMessage($emailHeaders);
if ($mailErrors) { die("Mail Error: $mailErrors"); 
}

Let me know if this doesn't work.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com