template html

78 views
Skip to first unread message

Hans

unread,
Nov 10, 2021, 11:15:08 AM11/10/21
to Bots Open Source EDI Translator
Hi All,

I've created a communicationscript to create html mail with edi message as attachment.
However i would like to do more with the EDI message content into the body of the mail, so i turned to the template-html grammar and mapping in BOTS.
I've created a route+mapping, but the mail i receive contains the HTML file as attachment named "ATT00001.xml".
the outgoing channel is set to As body or attachment: In body of email.
Did i miss a settings?

I also want to add a picture in the body. in the comm script it's done by
logo.add_header("Content-Disposition",'inline',filename='logo.jpg')
    logo.set_payload('/9j/4AAQSkZJ...BASE64encoded')
I there a simple way to add a picture to the html body mail? or also done by a comm script?

Is it also possible to add an attachment to the same mail? for example the a CSV file based on the same incoming EDI message?

Best regards,
Hans

Eppye Bots

unread,
Nov 12, 2021, 11:21:51 AM11/12/21
to 'Chuck Turco' via Bots Open Source EDI Translator
not sure why this goes wrong.
works for me.
email header should look like this:
From: x...@software.com
To: hjeb...@gmail.com
Message-ID: <20211109202103.14...@ip-172-30-2-100.stufff>
Date: Tue, 09 Nov 2021 14:21:03 -0600
Subject: subject 2021-11-09
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit

kind regards, Henk-Jan Ebbers


--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/b8e6bb62-6f63-4c80-bbd6-8b6e9fd7cdf0n%40googlegroups.com.

Hans

unread,
Nov 15, 2021, 5:33:42 AM11/15/21
to Bots Open Source EDI Translator
i read it could have something to do with MS exchange.
"The Exchange server insists that message text must always be first and attachments must always be last. As soon as the Exchange software sees one attachment in a message, it stops looking for text, and treats anything else in that message as an attachment. Any remaining text sections are converted into attachment sections, and given fake file names (like "ATT00001.htm")."
I've created a comminucationscript where i create the mail myself, then i've got no issues.

Another question, i want to bo able to process replies to this email.
i've set up a routescript postincommunication script to change the html to somethhing else. I would like to us beautifulsoup for it, but as soon as i import it in python, the routescript is skipped.
without importing bs4 the routescript works just fine. 
Any ideas why this is?


Op vrijdag 12 november 2021 om 17:21:51 UTC+1 schreef eppye:

Eppye Bots

unread,
Nov 15, 2021, 6:03:15 AM11/15/21
to 'Chuck Turco' via Bots Open Source EDI Translator
AFAIK bots has only ONE attachment/body per email message, so you should not run into this?
Not sure where the problem is?



that is strange (the issue with the import).
what happens?


kind regards, Henk-Jan Ebbers


Hans

unread,
Nov 17, 2021, 4:13:44 AM11/17/21
to Bots Open Source EDI Translator
If i send a template html over imap, bots creates a email header with not that much info.

Date: Wed, 10 Nov 2021 16:32:13 +0100 
Subject: 68900806 
MIME-Version: 1.0 
Content-Type: text/xml; charset="utf-8" 
Content-Transfer-Encoding: base64
....


If i put 'contenttype':'text/html', in the grammar it only changes the name of the attachment.

Date: Wed, 17 Nov 2021 09:43:17 +0100 
Subject: 69516286 
MIME-Version: 1.0 
Content-Disposition: attachment; 
 filename="PurchOrderCancel_4844.templatehtml" 
Content-Type: text/html; charset="utf-8" 
Content-Transfer-Encoding: base64
.....


In the communicationscript i've made i create a multipart email which works just fine.

Date: Thu, 11 Nov 2021 10:29:56 +0100 
Subject: 68981340 
MIME-Version: 1.0 
Content-Type: multipart/report; reporttype="disposition-notification"; 
 boundary="===============0093520282628398892==" 
Subject: Cancellation: 
 reply-to: em...@email.com 
 --===============0093520282628398892== 
Content-Type: text/html 

 <html> <head> <title>Mail Test</title>


about beautifulsoup, pip list said it was installed, but actually it wasn't en for some reason bots didn't thow an error.
after reinstallting beautifulsoup it worked.
I also set up a route to process a replied mail and extract/convert the html table to a CSV for further processing.
....
Op maandag 15 november 2021 om 12:03:15 UTC+1 schreef eppye:

Eppye Bots

unread,
Nov 17, 2021, 5:26:51 AM11/17/21
to 'Chuck Turco' via Bots Open Source EDI Translator
good that it works!

(not sure what the problem was. you mentioned that somehow outlook did not display a attachment the right way?)

kind regards, Henk-Jan Ebbers


Hans

unread,
Nov 17, 2021, 6:02:36 AM11/17/21
to Bots Open Source EDI Translator
Hi Henk-Jan,

The issue was that i wanted the templatehtml shown as email body (no attachment), but instead i received an empty body with an attachment called  "ATT00001.xml"

Op woensdag 17 november 2021 om 11:26:51 UTC+1 schreef eppye:
Reply all
Reply to author
Forward
0 new messages