How to trigger native html tag mailto from a static image (as a button) in a Mx app?

0
Hi guys,   I have Mendix mobile app where an static image (custom image uploaded via modeler) works as a link. Now I just simply want to trigger the native mobile email client by pressing on that image. Normally this is html technical valid: <a href="mailto:sample@email.com">E-mail</a><br /> Now I am wondering how I can do this within Mendix. I had now "show page" behind the static image, but this won't work seen I have to trigger the mobile mail client with a html code... So how can I do this, a javascript trick or so anyone? (i know that uploading an image to another external server and adding the image with that url into html snippet would also work, but i prefer to solve it with the asset within mendix)
asked
3 answers
1

Another way you could do it:

use the 'Link button' widget, which is part of the core  Mendix widget set.

  • This button can have an image included.
  • And can be configured with a e-mail / web / call /... onClick setting

Nice thing about this widget is that you can use a static link but also a dynamic link based on an attribute of an Entity

answered
1

Hi Enzo, you might try my DivButtonHelper widget, which makes any Mendix container clickable. I just tested it, and it works well for mailto URLs as well.

 

Direct download: here

Repository: here

I've seen a lot of use cases recently for this widget, so I've just submitted this to the app store for approval.

answered
0

Hi Enzo,

As an alternative to Eric's answer, you can base64 encode your image and use that value in the html snippet. Instead of uploading your image to an external server.

answered