Software Archive
Read-only legacy content
17060 Обсуждение

send email and input

ayman_a_
Начинающий
3 370Просмотр.

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 баллов
1 Решение
Elroy_A_Intel
Сотрудник
3 370Просмотр.

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
});

Просмотреть решение в исходном сообщении

6 Ответы
PaulF_IntelCorp
Сотрудник
3 370Просмотр.
Elroy_A_Intel
Сотрудник
3 371Просмотр.

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
});
ayman_a_
Начинающий
3 370Просмотр.

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 :(

PaulF_IntelCorp
Сотрудник
3 370Просмотр.

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

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

Jorge_F_1
Начинающий
3 370Просмотр.

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> 

PaulF_IntelCorp
Сотрудник
3 370Просмотр.

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.

Ответить