Hi all,
I made a notify automation which sends me an email with an inline image of our doorbell when someone rings the door. This works and when watching the mail in Outlook on a Mac, the inline picture is shown. When however looking at the mail in the Android Gmail app, the picture is not shown and only the alt line is shown.
Does someone know how to create a html email which shows inline pictures on the Android Gmail app?
This is what I have now:
My notify configuration in configuration.yaml:
notify:
- name: mail_trle
platform: smtp
sender: [email protected]
recipient: [email protected]
server: smtp.freedom.nl
port: 587
timeout: 30
username: [email protected]
password: XXX
encryption: starttls
sender_name: Home Assistant
The automation:
alias: "Email notificatie: deurbel wordt ingedrukt"
description: Stuur email wanneer de deurbel wordt ingedrukt
trigger:
- platform: device
device_id: 1b4d7c2c6725257c50bb3a8d4a69a48f
domain: nest
type: doorbell_chime
condition: []
action:
- service: camera.snapshot
data:
filename: /config/www/tmp/deurbel.jpg
target:
entity_id: camera.voordeur
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: notify.mail_trle
data:
message: Er heeft iemand op de deurbel gedrukt.
title: Er stond iemand voor de deur!
data:
images:
- /config/www/tmp/deurbel.jpg
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>
<div class="jumbotron jumbotron-fluid" style="background-color: #f00a2d; color: white;">
<div class="container py-0">
<h2>Er staat iemand bij de voordeur!!</h2>
</div>
</div>
<center><p>Iemand heeft zojuist op de deurbel gedrukt. Een foto van de persoon zie je hieronder.</p>
<p>Groeten van Home Assistant</p></center>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-6 px-0">
<center><img src="cid:deurbel.jpg" class="rounded" style="width: 50%;" alt="Foto gemaakt door de deurbel." /></center>
</div>
</div>
<br>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"></script>
</html>
mode: single
Thank you!