Problems creating HTML formatted emails in Drupal 8

Created on 6 March 2016, almost 9 years ago
Updated 6 December 2023, about 1 year ago

Hello,
I need help for creating HTML formatted emails in Drupal 8.0.5.

I want to make registration confirmation email in HTML format, to support HTML tags and images in "Account settings" configuration page ("admin/config/people/accounts" ).

I have tried with adding HTML tags inside "Account settings" configuration page . But while triggering the email , it is filtering and converting HTML to plain text .
Also tried altering hook_mail , and converting "['headers']['Content-Type'] = 'text/html"

function custom_module_mail_alter(&$message) {
  switch ($message['key']) {
    case 'register_no_approval_required':
	      $message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes';
      break;	  
  }	   
}

Still email is sending as plain text instead of HTML .

Is any one have issue fix for this . Appreciate your help.

Thank you .
Rabith Kuniyil.

πŸ’¬ Support request
Status

Fixed

Version

8.2 ⚰️

Component
MailΒ  β†’

Last updated 19 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States rabithk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024