Problem when sending an HTML Mail notification

Created on 10 July 2024, 4 months ago
Updated 3 September 2024, 2 months ago

Hi, I'm new to the Drupal community and I'm here today to ask about an issue I'm having when trying to send an HTML formatted email.

The problem is that I've formatted the email in the notification body using HTML tags to style it, but when it arrives at the recipient's inbox, it displays the tags instead of applying the styles.

How can I make this work properly?

πŸ› Bug report
Status

Active

Component

Code

Created by

πŸ‡ΊπŸ‡ΎUruguay CondenmedDev

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

Comments & Activities

  • Issue created by @CondenmedDev
  • πŸ‡ΊπŸ‡ΎUruguay CondenmedDev

    I found a solution to include HTML tags when working with Swift Mailer.

    All you need to do is mark the content as Full HTML and replace the symbols '<' and '>' in the tags with the corresponding HTML entity. For anyone who needs to do the same, I recommend writing the entire HTML content in a file and then using a find and replace tool to replace the symbols with the HTML entity.

    HTML Entities:

    < : & lt ;
    > : & gt ;
    

    Obviously, you have to write it without spaces; I've added spaces to prevent the browser from interpreting it.

    I hope my experience helps someone else. Thank you

  • I am facing the same issue. Emails are sent with HTML tags showing inside the email. Did you find a fix ?

Production build 0.71.5 2024