Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: E-mail action: Use file contents as body
Topic Summary:
Created On: 03/02/2007 10:34 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by TA-JOE, on Friday, March 2, 2007 1:14 PM

Answer:
I tried changing the setup of the image in the HTML, I tried using it from a mapped drive letter, a network share path, and from the internet, but unfortunately Outlook blocks them automatically without prompting, so this won't work for me. Unless I can embed the image in the html, but I don't know if thats possible and still be able to use it as a background image. Oh well, I can get the text notifications working great, but would be nice if I could add a background... Oh well..

Thanks!
 03/02/2007 10:34 AM
User is offline View Users Profile Print this message

Author Icon
TA-JOE
Journeyman (50-99)

Posts: 75
Joined: 10/03/2005

If I create an HTML template file for use with sending an e-mail in Automate 6, is there any way to use varibales in the HTML template? I setup an HTML file, wrote out some text with various formatting, and used some variables (%variablename%) in the HTML and when I get the e-mail I just the literal text, none of the variables are parsed. Any way to make that happen or is that not possible? Basically, I have some alerts I want to send, but would like to spruce them up a bit and use a background and text formatting, but the message has to be populated with variables. So far I can't seem to get that to work.

 Category Survey
 03/02/2007 11:20 AM
User is offline View Users Profile Print this message

Author Icon
Bart van Lagen
Supreme Guru (1000+)

Posts: 1400
Joined: 04/25/2005

That's a nice one.

You mean you have a HTML-file containing Automate vars like: %testvar%. And you use that file in an Automatetask this way:

createvar testvar
setvar  testvar to value  "xxxx"
....
send email using HTML-file as body
....

And that doesn't work?

You could try reading the template into a var, like strFileContent and replace: %%testvar%% with %testvar%
Next send the email not using the file as body but %strFileContent% as message!

 Category Survey


-------------------------
Bart van Lagen
ICT Department.
St Jansdal Hospital
Harderwijk, Netherlands
Automate 7.1.1.0 / BPA 7.1.1.0
Windows 2003SP2SRV
 03/02/2007 11:40 AM
User is offline View Users Profile Print this message

Author Icon
TA-JOE
Journeyman (50-99)

Posts: 75
Joined: 10/03/2005

Ok, I setup a few new vars, read the contents of my html template into a var. Then I made sure all my variables were included in the var that it read from the template. I can see everything in the var ok and it has my variables. Next, I go to my section where automate sends the e-mail, and use the varname that holds the read in HTML template. The task runs ok but the e-mail I get is blank. I have the box checked that says message is HTML.

 Category Survey
 03/02/2007 11:50 AM
User is offline View Users Profile Print this message

Author Icon
Bart van Lagen
Supreme Guru (1000+)

Posts: 1400
Joined: 04/25/2005

I'm not a HTML-expert, but I hope someone else can help you out in this matter.

 Category Survey


-------------------------
Bart van Lagen
ICT Department.
St Jansdal Hospital
Harderwijk, Netherlands
Automate 7.1.1.0 / BPA 7.1.1.0
Windows 2003SP2SRV
 03/02/2007 11:53 AM
User is offline View Users Profile Print this message

Author Icon
TA-JOE
Journeyman (50-99)

Posts: 75
Joined: 10/03/2005

Ok, I just checked something and I am getting the HTML e-mail, I didn't see it because in my HTML code, I set the font color to White, so it was invisible in Outlook. I have a colored background set in the html file, which the receiving e-mail client is supposed to download. That isn't working and I noticed that my variables in the HTML are printed literally, they are not parsing into the actual variable contents in Automate, just printing out %variablename% in the HTML...

 Category Survey
 03/02/2007 11:55 AM
User is offline View Users Profile Print this message

Author Icon
TA-JOE
Journeyman (50-99)

Posts: 75
Joined: 10/03/2005

I think I only have the one problem of my variables not resolving in the e-mail message. If I can get that working, the rest I can fix on my own. Anyone know why Automate won't display the variable content rather than printing the literal %variablename% code in the resulting e-mail? I would have thought using a variable as the message contents would cause the variables to resolve. But all I'm getting is literal automate code.

 Category Survey


Edited: 03/02/2007 at 12:00 PM by TA-JOE
 03/02/2007 12:33 PM
User is offline View Users Profile Print this message

Author Icon
Bart van Lagen
Supreme Guru (1000+)

Posts: 1400
Joined: 04/25/2005

If you have your HTML-message in a var replace all the vars in the HTML-file with their values.
Zum Beispiel: replace %%var%% (in your HTML-var) with %var% (the value of your var in your task), before sending the HTML-email. That must work.

 Category Survey


-------------------------
Bart van Lagen
ICT Department.
St Jansdal Hospital
Harderwijk, Netherlands
Automate 7.1.1.0 / BPA 7.1.1.0
Windows 2003SP2SRV
 03/02/2007 12:41 PM
User is offline View Users Profile Print this message

Author Icon
TA-JOE
Journeyman (50-99)

Posts: 75
Joined: 10/03/2005

I think I found a problem in Outlook, my settings for automatic download of internet content was set to disabled. I turned off that protection and now I can see the background image and my text. In my last attempt, it did give me the correct variable information in the HTML email message, but the spacing was way off, checking the HTML box in Automate, must cause issues with my spacing. I'm still working on this... But now I'm thinking, if the other people seeing this message have their Outlook setup the same way (default is internet content off) then they won't see the message correctly anyway. This might all be a big waste of time. :-(

 Category Survey
 03/02/2007 12:43 PM
User is offline View Users Profile Print this message

Author Icon
N i c k
Expert (100-199)

Posts: 183
Joined: 03/11/2006

i have a task that does this... will post later today. very easy to accomplish. very awesome automate function.

 Category Survey
 03/02/2007 01:14 PM
User is offline View Users Profile Print this message

Author Icon
TA-JOE
Journeyman (50-99)

Posts: 75
Joined: 10/03/2005

Answer Answer
I tried changing the setup of the image in the HTML, I tried using it from a mapped drive letter, a network share path, and from the internet, but unfortunately Outlook blocks them automatically without prompting, so this won't work for me. Unless I can embed the image in the html, but I don't know if thats possible and still be able to use it as a background image. Oh well, I can get the text notifications working great, but would be nice if I could add a background... Oh well..

Thanks!

 Category Survey
 03/02/2007 03:05 PM
User is offline View Users Profile Print this message

Author Icon
N i c k
Expert (100-199)

Posts: 183
Joined: 03/11/2006

As promised.
This task will loop through a ms access database and populate variables to send an e-mail. Down load all files to your c:\ drive.

You will need to update the server values on step 9 (mail user name and password)

Files to download:

demo.zip

zip includes the files below
* Send E-mail as HTML using Var from MS.Database Demo.AML
* customerdata.mdb
* Html_template.html (not required, but included so one could easy update html)



 Category Survey


demo.zip
demo.zip  (107 KB)

 09/01/2017 09:04 AM
User is offline View Users Profile Print this message

Author Icon
MatthewKoch
Apprentice (20-49)

Posts: 26
Joined: 12/19/2011

This thread is super old, but I'm having the same problem. Variables don't appear to be parsed when using an HTML file as the e-mail body - they just get written out as is. For example, instead of the value, you'll just see %VariableName% in the e-mail.

 Category Survey
 09/01/2017 09:07 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

Please confirm what version of AutoMate you are running, as well as the OS you are running it on?

 Category Survey


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1012 guests browsing this forum, which makes a total of 1012 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog