AnsweredAssumed Answered

Arcade expression with email image link

Question asked by cmcdonald@aberdeen on Oct 6, 2020
Latest reply on Oct 7, 2020 by cmcdonald@aberdeen

I would like to create a pop up in a webmap that shows an icon that you can click on which will generate an e-mail.

 

With help in this document Create a mailto link with Arcade I have managed to create the arcade expression below and it also includes a subject title and a field from the Layer.

 

var UPRN = $feature["UPRN_1"];
var email = "someone@someplace.com";
var subject = "Welfare Map issue with UPRN " + UPRN;
var params = {subject: subject};
var url = "mailto:" + email + "?" + UrlEncode(params);
url = Replace(url, "TextFormatting.NewLine", "%0D%0A");
return url;

 

In the pop up you can click the URL which opens e-mail application with the correct e-mail address and subject

 

 

Instead of displaying like above I would like an image/icon similar to what has been achieved in the document link above

 

I inserted the code into a new expression

<b>Maintenance history:</b><br />
{expression/expr0}
<br /><br />
<b>Email History:</b> <br />
<a href="{expression/expr1}">
  <img alt="Email" height="50" src="http://icons.iconarchive.com/icons/iynque/ios7-style/1024/Mail-icon.png" width="50" />
</a>

but this generates the error below when you 'Test'

Parse Error:Line 1: Unexpected token <

 

1) Do I need to create a separate expression?

2) What expression would work to display an image?

 

Thank you

Outcomes