Hannah
Posts: 0
Joined: Mon Sep 22, 2014 3:37 pm

Click an Email from a database and open in the Phones email service?

How can I click an email and open the phones email program and send an email to that email and some thing for clicking a phone number and opening that phone number in the phones dialer? These emails and phone number will be coming out of a data base. Is there a tutorial that will walk you though it?

Hannah
Posts: 0
Joined: Mon Sep 22, 2014 3:37 pm

Click an Email from a database and open in the Phones email service?

In the coding from that link they have a preset email address. I have a database that I would be pulling the emails from. How would I do that?

Hannah
Posts: 0
Joined: Mon Sep 22, 2014 3:37 pm

Click an Email from a database and open in the Phones email service?

I thought that these services were for working with Databases. I already have the database showing. What I need to do now is be able to click an email and open the phones email program and send an email to that specific email that was clicked and same with phone numbers. I have tried the following code for emails (That I got from the first reply, but this is for sending to a preset email address every time):

var link = "mailto:a href="mailto:feedback@example.com" rel="nofollow"feedback@example.com/a?subject="+Appery('feedbackSubject').val()+"&body="+Appery('feedbackMessage').val();
alert(link);
window.open(link);

and it does open the email but it does not select the email address that has been selected. What would I need to put in after the "mailto" to be able to pull that specific email address?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Click an Email from a database and open in the Phones email service?

Hello!

You can form mailto from input component with inputName name. For example this way prevar link = "mailto:" + Apperyio("inputName");/pre

Hannah
Posts: 0
Joined: Mon Sep 22, 2014 3:37 pm

Click an Email from a database and open in the Phones email service?

I have tried this code and it's still not working the email will not open.

While looking though other forums I have added "window.open(link);" and now the code i'm using is this:
var link = "mailto:" + Apperyio("imputName");
window.open(link);

It does open the email program in the phone but it doesn't put the specific email address in. Where the email address is supposed to be it has [object Object] and also opens a web page.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Click an Email from a database and open in the Phones email service?

Hi Hannah,

Sorry there was a typo.

Please try this code:

pre

//Where "inputName" is input component name.
var link = "mailto:" + Apperyio("inputName").val();

/pre

Regards.

Hannah
Posts: 0
Joined: Mon Sep 22, 2014 3:37 pm

Click an Email from a database and open in the Phones email service?

That still didn't work.

But I did get it to work using this code and saving the value to local storage first.

var link = "mailto:" + localStorage.getItem("imputName");
window.open(link);

and it does still open a blank web page, but that is better then it not working at all.

So I can use this same concept for making phone calls right?

Save the value to local storage first and then use this code:

window.location.href = "tel:" + localStroage.getItem("imputName"); << for androids
window.open('tel:' + localStorage.getItem("Phone"), 'system'); << for iphones

I was thinking that this would work but when I test the phone in the Appery Tester on the phone it does not open the dialer in the phone.

Is there a part of the code that I am missing?

Return to “Issues”