Software Archive
Read-only legacy content
17061 Discussions

send email and input

ayman_a_
Beginner
617 Views

hi

 

I did good code to send email without any problem, but i have 3 input I want to display in body of email 

 

how I can do to get it 

my input Id is a, b, c

this my code

 

cordova.plugins.email.isAvailable(
    function (isAvailable) {
        // alert('Service is not available') unless isAvailable;
    }
);
        cordova.plugins.email.open({
    to:      'a@a.com',
    subject: 'AAAAA',
    body:   '<h1>Nice greetings from Leipzig</h1>',


    isHtml:  true
});

 

0 Kudos
1 Solution
Elroy_A_Intel
Employee
617 Views

In this case, using jQuery you can add the value of your 3 input elements as following:

cordova.plugins.email.open({
    to:      'a@a.com',
    subject: 'AAAAA',
    body:   '<h1>'+ $('#a').val() + $('#b').val() + $('#c').val() +'</h1>',


    isHtml:  true
});

View solution in original post

0 Kudos
6 Replies
PaulF_IntelCorp
Employee
617 Views
0 Kudos
Elroy_A_Intel
Employee
618 Views

In this case, using jQuery you can add the value of your 3 input elements as following:

cordova.plugins.email.open({
    to:      'a@a.com',
    subject: 'AAAAA',
    body:   '<h1>'+ $('#a').val() + $('#b').val() + $('#c').val() +'</h1>',


    isHtml:  true
});
0 Kudos
ayman_a_
Beginner
617 Views

Elroy Ashtian Jr (Intel) wrote:

In this case, using jQuery you can add the value of your 3 input elements as following:

cordova.plugins.email.open({
    to:      'a@a.com',
    subject: 'AAAAA',
    body:   '<h1>'+ $('#a').val() + $('#b').val() + $('#c').val() +'</h1>',


    isHtml:  true
});

 

well done

it's working with me 

but I need add label before value of a or b or c like this

 

name: value of a

I did like this

cordova.plugins.email.open({
    to:      'a@a.com',
    subject: 'AAAAA',
    body:   '<h1>'First Name + $('#a').val() Last Name + $('#b').val() User Name+ $('#c').val() +'</h1>',


    isHtml:  true
});

but not working with me :(

0 Kudos
PaulF_IntelCorp
Employee
617 Views

You need to quote the strings you are concatenating. For example:

'<h1>' + "First Name" + $('#a').val() + ...

0 Kudos
Jorge_F_1
Beginner
617 Views

I'm from Brazil. Help me. I'm trying to email the Intel XDK and not be working. It does not send, no effect. The version of my Intel XDK 3357.
The cord-email-composer plugin is installed on my project. I am using the Bootstrap framework.

In the first example, I use intel.xdk.device.sendEmail and second, use the cordova.plugins.email.open. WHERE I AM missing?

I've done two code:
First example:

<body>
<input type="button" onclick="enviar3()" value="Exibir Alert" />
</body>

<head> 
<script type="text/javascript">
function enviar3()
{
alert("sss"); 
        intel.xdk.device.sendEmail("yyyyy", 
        "ajjaf77@gmail.com",    
        "teste",  // The subject
        true,                           // Is Html
        "",                             // CCed
        ""                              // BCCed
)};
</script>

 


Segund example:

<script>
    cordova.plugins.email.open({
    to:      'ajjaf77@gmail.com',
    cc:      'ajjaf@bol.com.br',
    subject: 'Greetings',
    body:    'How are you? Nice greetings from Leipzig'
});
</script> 

0 Kudos
PaulF_IntelCorp
Employee
617 Views

Do not use the " intel.xdk." plugins, they have been retired and are not being updated or maintained. There are many third-party Cordova plugins that provide far more features and are being maintained by the open source community. Check the "featured plugin" list, I believe there is an email plugin there. If not, search GitHub or the Cordova plugin registry for additional options.

0 Kudos
Reply