Subject Line for Push Emails

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
david.delano
Senior Boarder
Senior Boarder
Posts: 47
Joined: Thu May 16, 2013 6:39 am

Subject Line for Push Emails

Post by david.delano »

Is there any way to get a subject line for push emails?

User avatar
assenzuid
Expert Boarder
Expert Boarder
Posts: 93
Joined: Sat May 03, 2014 10:15 pm
Location: The Netherlands
Contact:

Re: Subject Line for Push Emails

Post by assenzuid »

And/Or more edit options for the email message (HTML format)

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6639
Joined: Mon Oct 01, 2007 10:51 pm

Re: Subject Line for Push Emails

Post by admin »

david.delano wrote:Is there any way to get a subject line for push emails?
yes, as explained in the wiki: :roll:
http://wiki.meteobridge.com/wiki/index. ... mail_Event

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6639
Joined: Mon Oct 01, 2007 10:51 pm

Re: Subject Line for Push Emails

Post by admin »

assenzuid wrote:And/Or more edit options for the email message (HTML format)
Never tried filling up the email body with HTML tags. Did you try? No success?

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6639
Joined: Mon Oct 01, 2007 10:51 pm

Re: Subject Line for Push Emails

Post by admin »

Doing some research about HTML email brought up a solution for that.

1) simply add "\nContent-Type: text/html" directly after the subject (before the # delimiter)
2) use html tags in the mail body

Example:

Code: Select all

Status [hh]:[mm]\nContent-Type: text/html#<html><body><h1>Outdoor</h1>temp: <u>[th0temp-act.1:--]&deg;C</u></body></html>
Returns a mail with subject "Status 12:34" and body looking like this:
sc1.png
sc1.png (6.85 KiB) Viewed 7490 times

User avatar
assenzuid
Expert Boarder
Expert Boarder
Posts: 93
Joined: Sat May 03, 2014 10:15 pm
Location: The Netherlands
Contact:

Re: Subject Line for Push Emails

Post by assenzuid »

Great, I will play with it and test it.

david.delano
Senior Boarder
Senior Boarder
Posts: 47
Joined: Thu May 16, 2013 6:39 am

Re: Subject Line for Push Emails

Post by david.delano »

I will try, too. No, I've never tried creating an email from html tags. Also, the wiki link just takes me to your weather station page.

I did extensive searching before posting this question and had not come up with a solution. I'm a software dev and can figure this out with this information. However, not all of your users have these skills, and need a somewhat more user friendly solution. Remember that some of use bought an off the shelf solution that uses Weatherbridge: we didn't put together our own solutions. We just want something that works.

david.delano
Senior Boarder
Senior Boarder
Posts: 47
Joined: Thu May 16, 2013 6:39 am

Re: Subject Line for Push Emails

Post by david.delano »

Now that I know what I'm looking for, I found the information: put a # (pound/hash/octalthorpe) between the subject and body of the email.

In my test email, which should come out in the next half hour, I put:

Rainfall Total at [hh]:[mm]#Total rainfall at [hh]:[mm] is [rain0total-sumday=in.2] inch(es).

I'll update when the message comes out......

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6639
Joined: Mon Oct 01, 2007 10:51 pm

Re: Subject Line for Push Emails

Post by admin »

david.delano wrote:Also, the wiki link just takes me to your weather station page.
Ooops, my fault. I updated the link to:
http://wiki.meteobridge.com/wiki/index. ... mail_Event

User avatar
wvdkuil
Platinum Boarder
Platinum Boarder
Posts: 514
Joined: Sun Jul 24, 2011 8:00 pm
Location: Belgium
Contact:

Re: Subject Line for Push Emails

Post by wvdkuil »

To get a nicer e-mail I want to include some html style settings.
There is a very nice template (as used for the ftp example) I try to use in an e-mail.
http://tau.meteobridge.com/templates/simpledash.html

That does not work as the message:
Meteobridge settings successfully reloaded
Warning (Event #01): Removed bad character in email body: "

Even with a one line message, the quote is removed in all occurences.
I found no way to have an " " " character correctly (translated) in the message part of the email .
But using class= or style = needs that double quote character.

Does anyone already found a solution?

Platform: Asus WL-330N3G
RAM: 29992 kB total, 5116 kB free (82% used)
Software Version: Linux 3.3.8 mips (LE), FW 1.0, MeteoBridge 2.3 (2581)

Wim
Support for Leuven-Template & Scripts at https://support.leuven-template.eu/
Support for the PWS_Dashboard (HWS-template) https://pwsdashboard.com/

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6639
Joined: Mon Oct 01, 2007 10:51 pm

Re: Subject Line for Push Emails

Post by admin »

Double quotes are not supported, try single quotes.

wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Subject Line for Push Emails

Post by wfpost »

I´m using sendEmail as it allows piping a complete html file into the text body

e.g. this command put into a shell script sending a weather report at the end of the months with graphs attached

/srv/www/meteohtml.cgi "/data/graphs/emailmonth.html" > /var/run/meteohub/email.out; cat /var/run/meteohub/email.out | sendEmail -f "METEOHUB <alix@myemail.de>" -t receiver@mail.com -u 'MONATSREPORT Wetter Honsolgen -' $(date +'%B %Y') -a /var/run/meteohub/Graph_$(date +'%B_%Y_%m_%d').png -s smtp.worldserver.net:25 -xu alix@myemail.de -xp password 2>&1 | /usr/bin/logger;

emailmonth.html >>>

Code: Select all

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="meteo honsolgen weather data">
<meta name="keywords" content="meteo honsolgen weather station">
<title>meteo honsolgen</title>
</head>
<body style=" background-color: #FFFFFF; font-family: Verdana, Helvetica, sans-serif; font-size: 10pt; color: #585858; text-align: left; background-attachment: fixed; background-image: url(images/picture.jpg); background-repeat: no-repeat; background-position: left bottom;">
<div style=" margin-top: 2%; margin-right: 6%; margin-bottom: 2%; margin-left: 6%;">
<h1 style="font-size: 92%; font-weight: bold; text-transform: lowercase; color: #678090; letter-spacing: 0.7em; padding-bottom: 1em; text-align: center;">meteo honsolgen</h1>
<h2 style="font-size: 71%; font-weight: bold; color: #6F9DBE; letter-spacing: 0.4em; text-transform: lowercase; font-family: Arial, Helvetica, sans-serif; text-align: center; text-transform: none;">&nbsp;Latitude&nbsp;N&nbsp;48&deg;&nbsp;1'&nbsp;25"&nbsp;&nbsp;&nbsp;Longitude&nbsp;E&nbsp;10&deg;&nbsp;46'&nbsp;26"&nbsp;&nbsp;&nbsp;Elevation&nbsp;627&nbsp;m</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 <caption style="align:center; font-size: 95%; font-style: normal; font-weight: bold; letter-spacing: .1em; padding-top: 0.5em; padding-bottom: 0.25em; text-align: left;"> Monthly records for [actual_date0_month_local]/[actual_date0_year_local]</caption>
  <tbody>
    <tr>
      <td colspan="3" style="font-size: 90%; font-weight: 400; background-color: #678090; color: #CCCCCC; padding: .5em; letter-spacing: .1em;">Temperature and Humidity </td>
    </tr>
    <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">High&nbsp;Temperature</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_th0_tempmax_c:-]&deg;C</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_th0_tempmax_time#GH]/[month1_th0_tempmax_time#EF] - [month1_th0_tempmax_time#IJ]:[month1_th0_tempmax_time#KL]&nbsp;</td>
    </tr>

    <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Low&nbsp;Temperature</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_th0_tempmin_c:-]&deg;C</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_th0_tempmin_time#GH]/[month1_th0_tempmin_time#EF] - [month1_th0_tempmin_time#IJ]:[month1_th0_tempmin_time#KL]</td>
    </tr>
	 <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Average&nbsp;Temperature</td>
      <td style="font-size: 100%; padding-top: 0.3em; padding-right: 0.5em; padding-bottom: 0.3em; padding-left: 0.5em; color: #222222;">[month1_th0_temp_c]&deg;C</td><td>&nbsp;</td>
      </tr>
        <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.3em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">High&nbsp;Humidity</td>
      <td style="font-size: 100%; padding-top: 0.3em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_th0_hummax_rel:-]%</td>
      <td style="font-size: 100%; padding-top: 0.3em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_th0_hummax_time#GH]/[month1_th0_hummax_time#EF] - [month1_th0_hummax_time#IJ]:[month1_th0_hummax_time#KL]&nbsp;</td>
    </tr>
    <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Low&nbsp;Humidity</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_th0_hummin_rel:-]%</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_th0_hummin_time#GH]/[month1_th0_hummin_time#EF] - [month1_th0_hummin_time#IJ]:[month1_th0_hummin_time#KL]</td>
    </tr>

      <td colspan="3" style="font-size: 90%; font-weight: 400; background-color: #8499A7; color: #CCCCCC; padding: .5em; letter-spacing: .1em;">Rainfall</td>
    </tr>
    <tr style="background-color: #F5E0CC;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Rainfall&nbsp;monthly</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_rain0_total_mm:-]&nbsp;mm</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">&nbsp;</td>

    </tr>
    <tr style="background-color: #F5E0CC;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Rainfall&nbsp;Rate&nbsp;Max </td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_rain0_ratemax_mm:-]&nbsp;mm/h</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_rain0_ratemax_time#GH]/[month1_rain0_ratemax_time#EF] - [month1_rain0_ratemax_time#IJ]:[month1_rain0_ratemax_time#KL]</td>
    </tr>
	    <td colspan="3" style=" font-size: 90%; font-weight: 400; background-color: #A2B1BD; color: #F5E0AA; padding: .5em; letter-spacing: .1em;">Sun</td>
    </tr>
    <tr style="background-color: #F5E0AA;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Solar Radiation Max&nbsp;monthly</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_sol0_radiationmax_wqm:-] W/m²</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_sol0_radiationmax_time#GH]/[month1_sol0_radiationmax_time#EF] - [month1_sol0_radiationmax_time#IJ]:[month1_sol0_radiationmax_time#KL]</td>
    </tr>
	    <tr style="background-color: #F5E0AA;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">UV Index Max&nbsp;monthly</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_uv0_indexmax:-]</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_uv0_indexmax_time#GH]/[month1_uv0_indexmax_time#EF] - [month1_uv0_indexmax_time#IJ]:[month1_uv0_indexmax_time#KL]</td>
    </tr>
      <td colspan="3" style="font-size: 90%; font-weight: 400; background-color: #A399AD; color: #666666; padding: .5em; letter-spacing: .1em;">Wind</td>
    </tr>
    <tr style="background-color: #F9EDE1;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Highest&nbsp;Gust</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_wind0_gustspeedmax_kmh]&nbsp;km/h &harr; [month1_wind0_gustspeedmax_bft]&nbsp;bf</td>

      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_wind0_gustspeedmax_time#GH]/[month1_wind0_gustspeedmax_time#EF] - [month1_wind0_gustspeedmax_time#IJ]:[month1_wind0_gustspeedmax_time#KL]</td>
    </tr>
    <tr style="background-color: #F9EDE1;">
    <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Wind main direction monthly</td>
    <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_wind0_maindir_de] &harr; [month1_wind0_maindir_deg]°</td>
    <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">&nbsp;</td>

  </tr>
    <tr>
      <td colspan="3" style=" font-size: 90%; font-weight: 400; background-color: #C0CAD3; color: #666666; padding: .5em; letter-spacing: .1em;">Pressure</td>
    </tr>
    <tr style="background-color: #FDFAF6;;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">High&nbsp;Pressure</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_thb0_sealevelmax_hpa:-]&nbsp;hPa</td>

      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_thb0_sealevelmax_time#GH]/[month1_thb0_sealevelmax_time#EF] - [month1_thb0_sealevelmax_time#IJ]:[month1_thb0_sealevelmax_time#KL]</td>
    </tr>
    <tr style="background-color: #FDFAF6;;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Low&nbsp;Pressure</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_thb0_sealevelmin_hpa:-]&nbsp;hPa</td>

      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[month1_thb0_sealevelmin_time#GH]/[month1_thb0_sealevelmin_time#EF] - [month1_thb0_sealevelmin_time#IJ]:[month1_thb0_sealevelmin_time#KL]</td>
    </tr>
	</tbody>
	</table>
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
 <caption style="align:center; font-size: 95%; font-style: normal; font-weight: bold; letter-spacing: .1em; padding-top: 2.5em; padding-bottom: 0.25em; text-align: left;"> Yearly records until [actual_date0_month_local]/[actual_date0_year_local]</caption>
  <tbody>
    <tr>
      <td colspan="3" style="font-size: 90%; font-weight: 400; background-color: #678090; color: #CCCCCC; padding: .5em; letter-spacing: .1em;">Temperature and Humidity </td>
    </tr>
    <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">High&nbsp;Temperature</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_th0_tempmax_c:-]&deg;C</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_th0_tempmax_time#GH]/[year1_th0_tempmax_time#EF] - [year1_th0_tempmax_time#IJ]:[year1_th0_tempmax_time#KL]&nbsp;</td>
    </tr>

    <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Low&nbsp;Temperature</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_th0_tempmin_c:-]&deg;C</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_th0_tempmin_time#GH]/[year1_th0_tempmin_time#EF] - [year1_th0_tempmin_time#IJ]:[year1_th0_tempmin_time#KL]</td>
    </tr>
	 <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Average&nbsp;Temperature&nbsp;this&nbsp;year</td>
      <td style="font-size: 100%; padding-top: 0.3em; padding-right: 0.5em; padding-bottom: 0.3em; padding-left: 0.5em; color: #222222;">[year1_th0_temp_c]&deg;C</td><td>&nbsp;</td>
      </tr>
        <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.3em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">High&nbsp;Humidity</td>
      <td style="font-size: 100%; padding-top: 0.3em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_th0_hummax_rel:-]%</td>
      <td style="font-size: 100%; padding-top: 0.3em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_th0_hummax_time#GH]/[year1_th0_hummax_time#EF] - [year1_th0_hummax_time#IJ]:[year1_th0_hummax_time#KL]&nbsp;</td>
    </tr>
    <tr style="background-color: #F1D3B7;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Low&nbsp;Humidity</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_th0_hummin_rel:-]%</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_th0_hummin_time#GH]/[year1_th0_hummin_time#EF] - [year1_th0_hummin_time#IJ]:[year1_th0_hummin_time#KL]</td>
    </tr>

      <td colspan="3" style="font-size: 90%; font-weight: 400; background-color: #8499A7; color: #CCCCCC; padding: .5em; letter-spacing: .1em;">Rainfall</td>
    </tr>
    <tr style="background-color: #F5E0CC;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Rainfall&nbsp;total this year</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_rain0_total_mm:-]&nbsp;mm</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">&nbsp;</td>

    </tr>
    <tr style="background-color: #F5E0CC;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Rainfall&nbsp;Rate&nbsp;Max </td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_rain0_ratemax_mm:-]&nbsp;mm/h</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_rain0_ratemax_time#GH]/[year1_rain0_ratemax_time#EF] - [year1_rain0_ratemax_time#IJ]:[year1_rain0_ratemax_time#KL]</td>
    </tr>
	    <td colspan="3" style=" font-size: 90%; font-weight: 400; background-color: #A2B1BD; color: #F5E0AA; padding: .5em; letter-spacing: .1em;">Sun</td>
    </tr>
    <tr style="background-color: #F5E0AA;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Solar Radiation Max&nbsp;this year</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_sol0_radiationmax_wqm:-] W/m²</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_sol0_radiationmax_time#GH]/[year1_sol0_radiationmax_time#EF] - [year1_sol0_radiationmax_time#IJ]:[year1_sol0_radiationmax_time#KL]</td>
    </tr>
	    <tr style="background-color: #F5E0AA;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">UV Index Max&nbsp;this year</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_uv0_indexmax:-]</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_uv0_indexmax_time#GH]/[year1_uv0_indexmax_time#EF] - [year1_uv0_indexmax_time#IJ]:[year1_uv0_indexmax_time#KL]</td>
    </tr>
      <td colspan="3" style="font-size: 90%; font-weight: 400; background-color: #A399AD; color: #666666; padding: .5em; letter-spacing: .1em;">Wind</td>
    </tr>
    <tr style="background-color: #F9EDE1;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Highest&nbsp;Gust</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_wind0_gustspeedmax_kmh]&nbsp;km/h &harr; [year1_wind0_gustspeedmax_bft]&nbsp;bf</td>

      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_wind0_gustspeedmax_time#GH]/[year1_wind0_gustspeedmax_time#EF] - [year1_wind0_gustspeedmax_time#IJ]:[year1_wind0_gustspeedmax_time#KL]</td>
    </tr>
    <tr style="background-color: #F9EDE1;">
    <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Wind main direction this year</td>
    <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_wind0_maindir_de] &harr; [year1_wind0_maindir_deg]°</td>
    <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">&nbsp;</td>

  </tr>
    <tr>
      <td colspan="3" style=" font-size: 90%; font-weight: 400; background-color: #C0CAD3; color: #666666; padding: .5em; letter-spacing: .1em;">Pressure</td>
    </tr>
    <tr style="background-color: #FDFAF6;;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">High&nbsp;Pressure</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_thb0_sealevelmax_hpa:-]&nbsp;hPa</td>

      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_thb0_sealevelmax_time#GH]/[year1_thb0_sealevelmax_time#EF] - [year1_thb0_sealevelmax_time#IJ]:[year1_thb0_sealevelmax_time#KL]</td>
    </tr>
    <tr style="background-color: #FDFAF6;;">
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">Low&nbsp;Pressure</td>
      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_thb0_sealevelmin_hpa:-]&nbsp;hPa</td>

      <td style="font-size: 100%; padding-top: 0.2em; padding-right: 0.5em; padding-bottom: 0.2em; padding-left: 0.5em; color: #222222;">[year1_thb0_sealevelmin_time#GH]/[year1_thb0_sealevelmin_time#EF] - [year1_thb0_sealevelmin_time#IJ]:[year1_thb0_sealevelmin_time#KL]</td>
    </tr>
	<tr>
	<td colspan="3" style="font-size: 91%; text-align: center; padding-top: 1em; padding-bottom: 1em; letter-spacing: 0.2em; background-color: #ffffff;">
	 :<a style="hover:text-decoration: underline overline; color: #6F9DBE;" href="http://www.myway.de/honsolgen/iwdl">iPhone</a>::<a style="hover:text-decoration: underline overline; color: #6F9DBE;" href="http://honsolgen.de">webcam</a>:</td>
    </tr>
  </tbody>
</table>
<hr>
<p style=" font-family: Arial, Helvetica, sans-serif; font-size: 70%; font-style: italic; text-transform: lowercase; letter-spacing: 0.3em; text-align: right;"><br>
Page updated [actual_localdate2] <br>powered by
<a href="http://meteohub.de" target="_blank">meteohub</a> v4.8g
</p>
</div>

</body>
</html>

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6639
Joined: Mon Oct 01, 2007 10:51 pm

Re: Subject Line for Push Emails

Post by admin »

But that is for Meteohub, not Meteobridge I guess.

wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Subject Line for Push Emails

Post by wfpost »

yep, sorry.

Just saw that the simpledash.html also using different variable names than on my meteohub.

Seems I need to get me one of this meteobridge gadgets to play around ...

Image

BTW: it´s working with sendmail as well

echo -n "date: ">/var/run/meteohub/emailwf.out; date >>/var/run/meteohub/emailwf.out; echo "to: tommi@gmail.com">>/var/run/meteohub/emailwf.out; echo "from: meteohub@googlemail.com">>/var/run/meteohub/emailwf.out; echo "Content-Type: text/html">>/var/run/meteohub/emailwf.out; /srv/www/cgi-bin/stamp.cgi echo "subject: Aktuelle Wetterdaten Honsolgen - \%d/\%m/\%y - \%H:\%M">>/var/run/meteohub/emailwf.out; echo "" >>/var/run/meteohub/emailwf.out; /srv/www/meteohtml.cgi "/data/graphs/emailwf.html">>/var/run/meteohub/emailwf.out; cat /var/run/meteohub/emailwf.out | /opt/sbin/sendmail -C /home/meteohub/esmtprc sender@gmail.com 2>&1 | /usr/bin/logger; rm /var/run/meteohub/emailwf.out

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6639
Joined: Mon Oct 01, 2007 10:51 pm

Re: Subject Line for Push Emails

Post by admin »

To prove that HTML mail is working fine I took the "simpledash.html" file from
"http://templates.meteobridge.com/simpledash.html", removed all linefeeds,
tabs and repeating blanks from it and replaced the double quotes (") by single
quotes('). In addition I put a subject header in front, so that the body input field
for sending a formatted HTML mail looks like this (it needs Meteobridge application
stack from August 25, 2014 or later running):

Code: Select all

weather at [hh]:[mm]\nContent-Type: text/html#<html> <style type='text/css'> #table-2 { border: 1px solid #e3e3e3; background-color: #f2f2f2; width: 500px; border-radius: 6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; } #table-2 td, #table-2 th { padding: 5px; color: #333; } #table-2 thead { font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; padding: .2em 0 .2em .5em; text-align: left; color: #4B4B4B; background-color: #C8C8C8; background-image: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#e3e3e3), color-stop(.6,#B3B3B3)); background-image: -moz-linear-gradient(top, #D6D6D6, #B0B0B0, #B3B3B3 90%); border-bottom: solid 1px #999; } #table-2 th { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px; line-height: 20px; font-style: normal; font-weight: normal; text-align: left; text-shadow: white 1px 1px 1px; } #table-2 td { line-height: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; border-bottom: 1px solid #fff; border-top: 1px solid #fff; } #table-2 td:hover { background-color: #fff; } </style> <body> <table id='table-2'> <thead><tr><th>Sensor</th> <th>Current</th> <th>Today (min)</th> <th>Today (max)</th></tr></thead> <tbody> <tr><td>Outdoor Temperature</td> <td>[th0temp-act.1:--]&deg; C</td> <td>[th0temp-dmin.1:--]&deg; C</td> <td>[th0temp-dmax.1:--]&deg; C</td></tr> <tr><td>Outdoor Humidity</td> <td>[th0hum-act.0:--] %</td> <td>[th0hum-dmin.0:--] %</td> <td>[th0hum-dmax.0:--] %</td></tr> <tr><td>Outdoor Dew Point</td> <td>[th0dew-act.1:--]&deg; C</td> <td>[th0dew-dmin.1:--]&deg; C</td> <td>[th0dew-dmax.1:--]&deg; C</td></tr> <tr><td>Wind Chill Temperature</td> <td>[wind0chill-act.1:--]&deg; C</td> <td>[wind0chill-dmin.1:--]&deg; C</td> <td>[wind0chill-dmax.1:--]&deg; C</td></tr> <tr><td>Air Pressure</td> <td>[thb0seapress-act.1:--] hPa</td> <td>[thb0seapress-dmin.1:--] hPa</td> <td>[thb0seapress-dmax.1:--] hPa</td></tr> <tr><td>Wind Direction</td> <td>[wind0dir-act.0:--]&deg;</td> <td></td><td></td></tr> <tr><td>Wind Speed (averaged)</td> <td>[wind0avgwind-act.1:--] m/s</td> <td>[wind0avgwind-dmin.1:--] m/s</td> <td>[wind0avgwind-dmax.1:--] m/s</td></tr> <tr><td>Gust Speed</td> <td>[wind0wind-max5.1:--] m/s</td> <td>[wind0wind-dmin.1:--] m/s</td> <td>[wind0wind-dmax.1:--] m/s</td></tr> <tr><td>Rain</td> <td>rate: [rain0rate-act.1:--] mm/h</td> <td>sum: [rain0total-sumday.1:--] mm</td> <td></td></tr> <tr><td>Solar Radiation</td> <td>[sol0rad-act.0:--] W/qm</td> <td>[sol0rad-dmin.0:--] W/qm</td> <td>[sol0rad-dmax.0:--] W/qm</td></tr> <tr><td>UV Index</td> <td>[uv0index-act.1:--] uvi</td> <td>[uv0index-dmin.1:--] uvi</td> <td>[uv0index-dmax.1:--] uvi</td></tr> </tbody> </table> </body> <html>
When the mail reaches my inbox it looks like this:
htmlmail.png
htmlmail.png (63.51 KiB) Viewed 7383 times

Post Reply