I try to use HTML in the Workflow Email Body. The result looks like that:
I have 2 questions:
<<Start>> <<End>>
expression to work, so that it does new lines for every new record?My HTML Code is:
<font face="Arial"><h1>Bestellung</h1><font face="Arial"><table border="1" style="width: 100%; border-collapse: collapse; float: left; border-style: solid;"><tr><td style="width: 15.4087%; background-color: #0069b3;"><span style="color: #ffffff;">Mitarbeiter:</span></td><td style="width: 84.5913%;"><<MitarbeiterVC>></td></tr><tr><td style="width: 15.4087%; background-color: #0069b3;"><span style="color: #ffffff;">Kommission:</span></td><td style="width: 84.5913%;"><<Kommission>></td></tr><tr><td style="width: 15.4087%; background-color: #0069b3;"><span style="color: #ffffff;">Bemerkung:</span></td><td style="width: 84.5913%;"><<Bemerkung>></td></tr></table></font>
<table border="1" style="width: 100%; border-collapse: collapse; float: left; border-style: solid;"><tbody><tr><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Händler</span></strong></td><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Artikelnummer</span></strong></td><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Artikel</span></strong></td><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Anzahl</span></strong></td><td style="width: 20%; background-color: #0069b3;"><strong><span style="color: #ffffff;">Bemerkung</span></strong></td></tr><tr><td style="width: 20%;"><<Start:ORDERBY([Related Bestellungs] , [Händler])>><<Händler>></td><td style="width: 20%;"><<ArtikelNr.>></td><td style="width: 20%;"><<Artikel>></td><td style="width: 20%;"><<Anzahl>></td><td style="width: 20%;"><<Bemerkung>><br><<IFS([Lagerfach] = "Ja" , "Lagerfach anlegen!")>><<End>></td></tr></tbody></table>
<a href='<<CONCATENATE('https://www.appsheet.com/start/893a9bce-fd34-4ecb-a9bb-1d7cc344ae2b#appName=Inventur-38452&page=detail&row=',[Key],'&table=Kommission&view=Kommission_Detail')>>' target='_blank' rel='noopener' title='Bestellung öffnen'><img src="https://imgplaceholder.com/300x50/0069b3/ffffff?text=Bestellung+%C3%B6ffnen&font-size=30" alt="Bestellung öffnen" width="300" height="50" caption="false" style="float: left;" /></a>
<a href='<<CONCATENATE('https://script.google.com/a/walk-korntal.de/macros/s/AKfycbzGWNp2f4rC2lyQc2sfjnwTdlJFmNAZRFZcL6w/exec?ID=',[Key],'&Option=erledigt')>>' target="_blank" rel="noopener" title="Bestellung erledigt"><img src="https://imgplaceholder.com/300x50/008F33/ffffff?text=Bestellung+erledigt&font-size=30" alt="Bestellung erledigt" width="300" height="50" caption="false" style="float: left;" /></a></font>
Solved! Go to Solution.
I would create a Google Doc and then use the Google Docs export feature to save it as an HTML file. That will allow you to see exactly what your HTML should look like.
Do this as follows:
That is exactly what AppSheet is doing when you use a Google Doc template.
@Phil can you help me?
I can investigate if you provide:
Thank you @Phil for investigating.
Account ID: 651676
appName=Inventur-38452-651676
Rule Name: Bestellung Parent
Please have a look in the Email Body
Hi Fabian,
Your template is not being treated as HTML because it does not start with one of the following values:
<Body <Head or <HtmlMake one of these three HTML elements the first thing in your template, and add the matching closing HTML tag at the end of the template.
In an HTML file the value << must be HTML encoded as <<
The value >> must be HTML encoded as >>
There appear to be other problems in your template also because it fails HTML parsing.
You might be better off using a Google Doc template.
Thank you Phil for those points. I will give it another try. My goal is to get a clickable button in the Email Body. This is not possible with a Google Doc Template AFAIK.
What do you mean by this?
Sorry about that.
<<
characters must be encoded as an <<
>>
characters must be encoded as an >>
@LeventK Do you have any simple HTML Email Body with <> expression that you could share?
I’m struggling…
I would create a Google Doc and then use the Google Docs export feature to save it as an HTML file. That will allow you to see exactly what your HTML should look like.
Do this as follows:
That is exactly what AppSheet is doing when you use a Google Doc template.
@Phil I did exactly what you said. Then I copied the HTML and pasted it into the Email Body.
Error: Workflow rule 'Bestellung Parent' action 'Action 1' Body template. Template could not be loaded due to exception: The 'meta' start tag on line 1 position 14 does not match the end tag of 'head'. Line 1, position 5323.
I had to delete the <meta content="text/html; charset=UTF-8" http-equiv="content-type">
Part. After that I also needed to change the special character ä
into “ä” and the “Ja”
into "Ja"
.
Glad to hear that you got it to work.
@Fabian_Weller Does this part really work for you?
<a href='<<CONCATENATE('https://www.appsheet.com/start/893a9bce-fd34-4ecb-a9bb-1d7cc344ae2b#appName=Inventur-38452&page=detail&row=',[Key],'&table=Kommission&view=Kommission_Detail')>>' target='_blank' rel='noopener' title='Bestellung öffnen'>
I have a similar part in my HTML, but I get an error since I added this part. Any idea why it fails?
<p><span><<[Material].[Bezeichnung]>> (<a href="<<[Material].[Produktkatalog]>>">Produktinfos</a>)</span></p>
<<[Material].[Produktkatalog]>> should give a link.
Error message is quite unhelpful as line 1 position 1001 does not exist in my html:
Hi @mika134 yes it is still working. This is my HTML code in the field "Email Body".
Maybe the problem in your code is the round brackets? I think you should not use them.
(<a href="<<[Material].[Produktkatalog]>>">Produktinfos</a>)
Thanks @Fabian_Weller
I found an easier way, at least for me. I now use the appsheet variable instead.
<<HYPERLINK([Material].[Produktkatalog],"Produktinfos")>>
User | Count |
---|---|
36 | |
31 | |
30 | |
20 | |
17 |