Skip to main content

Hello,

 

I used AA A360 and i want to use a variable in an email send with HTML design.

This does not work in HTML design, but only in plain text.

 

Is there a way to still use a variable in HTML design?

 

mail

Hi,

 

I think no way


Believe it has to be HTML Code. You can convert Text to HTML Code using an online converter like https://www.textfixer.com/html/convert-text-html.php


Looks to be a limitation.. I do not see a way to achieve it & was forced to use HTML code instead.


This needs to be fixed, as it requires a ton of work writing out HTML code for long links that are better suited as alt text, where you want to also include variables for other items. 


Hi All,

 

In A360, when sending emails with HTML design, using variables directly inside the HTML content may not work as expected if you insert them as plain text.

To use a variable inside an HTML email body, you typically need to:

  1. Construct the entire HTML content as a string variable, embedding the variable values dynamically within that string.
  2. Use that string variable as the email body in the "Send Email" action set to HTML format.

For eg:

  • Create a string variable that holds your HTML content.
  • Within that string, concatenate or insert your variable values in the appropriate places.
  • Pass this string variable as the email body with the HTML Design option enabled.

This approach allows the variable values to be rendered correctly inside the HTML email.


Hi All,

 

In A360, when sending emails with HTML design, using variables directly inside the HTML content may not work as expected if you insert them as plain text.

To use a variable inside an HTML email body, you typically need to:

  1. Construct the entire HTML content as a string variable, embedding the variable values dynamically within that string.
  2. Use that string variable as the email body in the "Send Email" action set to HTML format.

For eg:

  • Create a string variable that holds your HTML content.
  • Within that string, concatenate or insert your variable values in the appropriate places.
  • Pass this string variable as the email body with the HTML Design option enabled.

This approach allows the variable values to be rendered correctly inside the HTML email.



How do you put variables in the default value section of the String variable creation window?


Hi All,

 

In A360, when sending emails with HTML design, using variables directly inside the HTML content may not work as expected if you insert them as plain text.

To use a variable inside an HTML email body, you typically need to:

  1. Construct the entire HTML content as a string variable, embedding the variable values dynamically within that string.
  2. Use that string variable as the email body in the "Send Email" action set to HTML format.

For eg:

  • Create a string variable that holds your HTML content.
  • Within that string, concatenate or insert your variable values in the appropriate places.
  • Pass this string variable as the email body with the HTML Design option enabled.

This approach allows the variable values to be rendered correctly inside the HTML email.



How do you put variables in the default value section of the String variable creation window?

There is an action called String-> Assign. You can use that.


Hi All,

 

In A360, when sending emails with HTML design, using variables directly inside the HTML content may not work as expected if you insert them as plain text.

To use a variable inside an HTML email body, you typically need to:

  1. Construct the entire HTML content as a string variable, embedding the variable values dynamically within that string.
  2. Use that string variable as the email body in the "Send Email" action set to HTML format.

For eg:

  • Create a string variable that holds your HTML content.
  • Within that string, concatenate or insert your variable values in the appropriate places.
  • Pass this string variable as the email body with the HTML Design option enabled.

This approach allows the variable values to be rendered correctly inside the HTML email.



How do you put variables in the default value section of the String variable creation window?

 

You can use String -> Assign action.


Hi All,

 

In A360, when sending emails with HTML design, using variables directly inside the HTML content may not work as expected if you insert them as plain text.

To use a variable inside an HTML email body, you typically need to:

  1. Construct the entire HTML content as a string variable, embedding the variable values dynamically within that string.
  2. Use that string variable as the email body in the "Send Email" action set to HTML format.

For eg:

  • Create a string variable that holds your HTML content.
  • Within that string, concatenate or insert your variable values in the appropriate places.
  • Pass this string variable as the email body with the HTML Design option enabled.

This approach allows the variable values to be rendered correctly inside the HTML email.



How do you put variables in the default value section of the String variable creation window?

 

You can use String -> Assign action.



So literally put the entire contents of a possible long email in a single line on the string assign action? You cannot expand to see if it’s formatted correctly?


Hi All,

 

In A360, when sending emails with HTML design, using variables directly inside the HTML content may not work as expected if you insert them as plain text.

To use a variable inside an HTML email body, you typically need to:

  1. Construct the entire HTML content as a string variable, embedding the variable values dynamically within that string.
  2. Use that string variable as the email body in the "Send Email" action set to HTML format.

For eg:

  • Create a string variable that holds your HTML content.
  • Within that string, concatenate or insert your variable values in the appropriate places.
  • Pass this string variable as the email body with the HTML Design option enabled.

This approach allows the variable values to be rendered correctly inside the HTML email.



How do you put variables in the default value section of the String variable creation window?

 

You can use String -> Assign action.



So literally put the entire contents of a possible long email in a single line on the string assign action? You cannot expand to see if it’s formatted correctly?

 

While assigning the value, the field will get auto-expanded based on the length of the content. Once you finished and saved, it will shrink to its actual appearance (doesn't mean that your original content will also gets shrinked)

 

If you feel it is less convenient, you may generate the content on a Notepad and later copy-paste it to the assign section.

 

 


Not quoting this time, as it’s getting kind of messy. But the source string value section doesn’t expand on our systems, is there something that has to be enabled in the control room? 


Not quoting this time, as it’s getting kind of messy. But the source string value section doesn’t expand on our systems, is there something that has to be enabled in the control room? 

 

Nothing needs to be enabled, as it is the CR feature. Even though the string representation in the Assign action has nothing to do with the actual appearance of your mail body, I would recommend generating the content in Notepad and copy-pasting it to the Assign action later on.


If it’s a feature, why doesn’t that assign string box not expand as you mentioned within our environment? Did you see the attached screenshot?


If it’s a feature, why doesn’t that assign string box not expand as you mentioned within our environment? Did you see the attached screenshot?

 

@Chris 621,

I don't see the actual problem here. Is it the expansion of Assign action field section or the end result?

Did you tested the HTML value via String assign action?

If not, kindly test the same and let me know the outcome.

 

If your concern is the customization of the HTML data, please do it through a Notepad and copy-paste the same to Assign action afterwards.

 

As I am continuously saying, the way of data representation in the Assign action has nothing to do with the end result.


Unfortunately your solution does not work, the formatting is completely mangled and lost by putting this into a String Assign variable, even when attempting to use a text editor to assist with formatting. And fruitless against extremely long web links that still display. The solution needs to be that AA allows variable insertions into the HTML design of the body of emails. Every other solution is a band-aid or very difficult to implement.


@Padmakumar ​@Chris 621 Wow, we’re still talking about this. (rolls up sleeves) Here is what I use for my bulk email sending bot which, if you’re on our email lists, you received an email from this bot! Here’s one I sent out earlier today.

I start with an HTML version of the email, which I create in Notepad ++ with the HTML Preview plugin to make sure I haven’t done something stupid like leave a tag open.

Notice I’m using $sFirstName$ in the HTML code. This was a conscious design decision so I could either use String: Evaluate variable (a very underappreciated action) or String: Replace to put the value I want in the right place.

To make it simpler for others to use, I started with a form that accepts the subject (plain text), the body of the email (HTML), and the spreadsheet that contains the names. Since I can’t control the format of the spreadsheet, I have options in the form for choosing if the spreadsheet contains a header or not, along with the numeric index of the columns within the spreadsheet for first name, last name, and email address. Why a numeric index? Because, if the spreadsheet doesn’t contain a header, I can still get to the data using the index.

This form gets displayed by a Process and the data is sent to my task bot which sends the emails.

First, it receives the file from the form (actions 2 and 3), opens the file (4), and connects to our email server (5). 

Next, it loops through all the records in the spreadsheet (7) and keeps track of the row count in $nCount$. This is so we can skip the headers (9 and 10) if necessary. I then take the HTML value from the form (11) and use some String: Replace actions to replace $sFirstName$ with the value from the spreadsheet (12), $sLastName$ (13), and even $sEmail$ (14) if we wanted to display the user’s email within the body of the message (e.g., “This email was sent to spam@spam.com.”). 

I then send the updated HTML body out as an email (16) and log the email address with date/time (17) to a file in case things go wrong. Finally, I disconnected from the email server (19), closed the spreadsheet (20), and deleted the temp file (21).

You’re welcome to build off this code or improve on it, maybe with a String: Evaluate variable. 

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/string-package-evaluate-variable-action.html


Unfortunately your solution does not work, the formatting is completely mangled and lost by putting this into a String Assign variable, even when attempting to use a text editor to assist with formatting. And fruitless against extremely long web links that still display. The solution needs to be that AA allows variable insertions into the HTML design of the body of emails. Every other solution is a band-aid or very difficult to implement.

I beg to differ. I've personally tested the given solution in multiple projects and never encountered any issues.


“Pass this string variable as the email body with the HTML Design option enabled.”

You cannot put variables into the HTML design section, that’s the primary issue. See screenshot below. 


It is true that the String Assign does expand (sometimes) when you grab a fresh copy of the action, but when you save the variable, it immediately strips all formatting. See screenshot below.


And finally below you can see all formatting stripped in the final product (just one big paragraph, but I cropped for expediency), whether the string assign variable is put into the plain text body or HTML code of the Email action:


Since I don’t have a text to HTML converter on the job site, I resorted to using https://text-html.com/ to assist in quickly generating the HTML for use in the HTML Code section instead. With a bit of manipulation, I was finally able to get that to work. Didn’t find that HTML Preview plugin for Notepad++ that Aaron suggested. What is the exact name of the plugin ​@Aaron.Gleason?


@Chris 621 The plug-in in Notepad++ is called Preview HTML.

This plug-in has one limitation that I know of: If you’re working with HTML, you have to either save the file as a .htm/.html and/or set the Language to HTML (language menu). It won’t even open the preview window if the file isn’t considered an HTML file.

Edit: That Text to HTML site is pretty great!


Reply