home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.88k stars 30.95k forks source link

GMail Integration Attaching Images not working #126008

Open wkongucd opened 2 months ago

wkongucd commented 2 months ago

The problem

Seems like gmail integration does not support inline images with html email notification. When I used to use the original HomeAssistant SMTP integration to communication to my gmail account, it worked. But switch over to the new gmail integration lacked this image feature.

Will there be support for attach/include images with gmail integration?

What version of Home Assistant Core has the issue?

core-2024.9.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

google_mail

Link to integration documentation on our website

https://www.home-assistant.io/integrations/google_mail/

Diagnostics information

No response

Example YAML snippet

action: notify.notifier_gmail_com
data:
  target: 
   - my_target_email@gmail.com
  title: Testing Email Again
  message: "Test Email"
  data:
    images: 
      - /config/www/my_image.png
    html: >
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"
      xmlns="http://www.w3.org/1999/xhtml">
          <head>
              <meta charset="UTF-8">
              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
              <meta name="viewport" content="width=device-width, initial-scale=1.0">
              <title>Intruder alert</title>
              <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css">
              <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
              <style type="text/css">
                  @font-face {
                    font-family: 'Open Sans';
                    font-style: normal;
                    font-weight: 300;
                    src: local('Open Sans Light'), local('OpenSans-Light'), url(http://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTZS3E-kSBmtLoNJPDtbj2Pk.ttf) format('truetype');
                  }
                  h1,h2,h3,h4,h5,h6 {
                      font-family:'Open Sans',Arial,sans-serif;
                      font-weight:400;
                      margin:10px 0
                  }
              </style>
          </head>
          <body>
          This is HTML version of the content.
                  <img class="rounded" style="width: 100%;"
                      alt="my_image" src="cid:my_image.png" />
          </body>
          </html>

Anything in the logs that might be useful for us?

I made sure I did add the following to my configurations.yaml as well:

  allowlist_external_dirs:
    - /config/www/

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @tkdrob, mind taking a look at this issue as it has been labeled with an integration (google_mail) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `google_mail` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign google_mail` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


google_mail documentation google_mail source (message by IssueLinks)

wkongucd commented 2 weeks ago

Hi @tkdrob , has there been any updates to this issue I posted on not being able to see the HTML inline images?