$host = \Drupal::request()->getHost(); ==> drupal.dev
$host = \Drupal::request()->getSchemeAndHttpHost(); ==> http://drupal.dev
$host = \Drupal::request()->getHost(); ==> drupal.dev
$host = \Drupal::request()->getSchemeAndHttpHost(); ==> http://drupal.dev
$token = \Drupal::token(); $message_html = "hello [current-page:title] ----- [amount-node:amount:2]"; // Replace the token for subject. $email_auth = $token->replace($message_html, array('amount-node' => $amount));
ถ้า Token มี html มันจะไม่ render html เราต้องใช้ function " htmlspecialchars_decode "
ตัวอย่าง :
htmlspecialchars_decode($email_auth);