How can I set email links in buttons/text? I try using mailto:somebody@company.com?subject=Hello as a Web Address. When i click on the button/link, nothing happens.
Starting from AGOL 10.3, you can configure mailto and some other URI schemes directly in the 'Set Link > URL' for widgets like Button, Image, etc. See details in:
https://doc.arcgis.com/en/experience-builder/latest/build-apps/add-widgets.htm#ESRI_SECTION1_0F7788FDC39040CC8B969DB036C354AA
Same here! Such an annoying issue - nothing seems to be working.
Has anyone come across a solution to this in Experience builder (preferably with as little code as possible. The Esri documentation says I can just add an email like to a button widget with mailto:email but this does not open an email app when clicked... it is the same when I use the embed widget and <a href="mailto:somebody@company.com ">Send email</a> in the code section.
Surely if it is stated in the official documentation it should be working? Otherwise could it be an error with my specific Enterprise version?
Thanks for this fix! However when I paste the link from Word, still nothing happens when I click on it. How do I make the link open the email app? (Outlook in this case)
Hi @CandiceBardsley1 - Portal 10.9.1 is about five releases ago compared to the AGOL 10.3 code, so unfortunately, no. For Enterprise versions, it should be there since Portal 11.1.
I'm trying to do the same thing but in portal 10.9.1 - I can't see the options you show in the link provided - is that not an option in this version?
@TonghuiMing
Yes, @JRhodes , but you can't add the mailto: text in front of the attribute
@LindaSlattery Did you click the button to the left of the URL box? It allows you to select an attribute from the connected data source:
All acceptable syntax for the supported schemes has been documented in the doc link posted above:
I don't think symbol {} is a valid syntax for any standard URI scheme. Besides, in your case, this seems like a dynamic email URL from a data source, while the Set Link > URL workflow in the Button widget (or others) only supports static URLs - Typing '{}' directly does not have the data structure for now so that's expected, unfortunately.
@TonghuiMing it still doesn't work correctly. The email tries to open the attribute instead of the email that is actually in the data (see screenshot below). In the URL box, I am typing in mailto:{resource_contact_email2}. Should I be doing something else?
However, if you are trying to link to an email that is an attribute in the feature layer, I cannot get it to work. I have a list in ExB and email is a field that is unique to each data point. Any suggestions on this?
Nice find, @SallyCox1 ! It works perfectly! This was something that was giving me grief for some time.
I have a related question @DavidMartinez which at this point is more of an html question than ExB BUT how can I modify the color, font, and alignment (from left to center) of the text? I know no html and am having a hard time modifying your code to meet my needs.Thanks!
I discovered the fix purely by accident. If you type the email address in a Word document and hit return, Word automatically hyperlinks the address with the "mailto" link. Copy that linked email and paste it directly into your Experience content and it retains the mailto link.
@DavidMartinez , I'm just starting with custom embed code, and am struggling to work out how to get a mailto embed to work within a Card (which im using in absence of this functionality on a button).
So if I drop the embed code widget into the Card container, with the following code:
<a href=mailto:"XDAOO@orsted.com, JOHLE@orsted.com?subject=HOW04%20-%20WindGIS%20Feedback"></a>
...how do i get this code to run when I click on the Card? or is this not possible?
@JonathanMcDougall i think this question is also for you, as im following your advice above.
@Jianxia is this something you might be able to help with?
@MeghanJones
Best bet would be to take your html and run it through an HTML code checker or compiler - something like w3 schools - or mailtolink.me
For anyone else looking for the "button" experience, I can't remember if I included this in my response to a similar question a couple of weeks back, giving embed as the solution, simply make a card, shape it, outline it, then put in the embed widget. You can set the on hover for the card too.... so a fake button. Or just create an html button with the email code too.
Is there a way to link the code to the data being used in Experience Builder? For example, I have an attribute field {email} populated by several different groups (data coming from Survey123). I want to create a link/button for interested parties to click to "contact us". When I input the code above, it opens my default email application, but the name obviously is not populated with the email from that attribute. Is this possible?
Hi David,
Could you please assist why my mailto code is not working? In Experience Builder, I added the embed widget and in the Content > Embed by > Code window I wrote this:
<ahref="mailto:mjones@ljbinc.com?cc=mbell@ljbinc.com&subject=Amazon%20Fall%20Protection%20Site%20Technical%20Assistance%20Needed&body=Hello%20-%0D%0A%0D%0APlease%20provide%20assistance%20with%3A ">Need Help? Contact us for Technical Support</a>
When saved and published, the embed link does not work. Is there something wrong with my code? Thank you in advance!
Hi Nikholai,
Currently, the only way to add this is via the embed widget via code. For example, <a href="mailto:somebody@company.com ">Send email</a>. I will log an issue for us to look at how we can support this in other widgets.
Thanks,
David
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.