# Placing variable into HTML email

**URL:** <https://forum.inductiveautomation.com/t/placing-variable-into-html-email/32255>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [February 14, 2020, 12:24am UTC](https://forum.inductiveautomation.com/t/placing-variable-into-html-email/32255 "2020-02-14T00:24:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![preston.j.williams](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@preston.j.williams](https://forum.inductiveautomation.com/u/preston.j.williams)\
**Post date:** [February 14, 2020, 12:24am UTC](https://forum.inductiveautomation.com/t/placing-variable-into-html-email/32255/1 "2020-02-14T00:24:49Z")

</div>

I have a variable of type string called “self.custom.var” that I want to put into an HTML email.

```auto
body = "<HTML><BODY><H2>Your variable is + self.custom.var</H2>"

```

I have also tried

```auto
body = "<HTML><BODY>
<p>Your variable is: <br>
<br><br><h1> {help_me} </H1><br>
<p>"
body.format(help_me = self.custom.var)

```

I can’t seem to figure this out. Any hints?

Thank you,

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [February 14, 2020, 12:41am UTC](https://forum.inductiveautomation.com/t/placing-variable-into-html-email/32255/2 "2020-02-14T00:41:38Z")

</div>

try  
`body = "<HTML><BODY><H2>Your variable is" + self.custom.var + "</H2>"`  
This does assume self.custom.var is a string type. If it’s not then you can cast it like  
`body = "<HTML><BODY><H2>Your variable is" + str(self.custom.var) + "</H2>"`

---

<div class="post-metadata">

**Author:** ![preston.j.williams](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@preston.j.williams](https://forum.inductiveautomation.com/u/preston.j.williams)\
**Post date:** [February 14, 2020, 12:57am UTC](https://forum.inductiveautomation.com/t/placing-variable-into-html-email/32255/3 "2020-02-14T00:57:07Z")

</div>

This solved it! Thank you very much!
