Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Raj_Kumar
Novice
148 Views

email plugin not working, please help !!

I am trying to develop an app and apparently it should trigger an email and I am trying to use Cardova plugin and calling the below two functions and none of them are working, does anybody has any examples, please advise.

window.plugins.emailComposer.showEmailComposerWithCallback

cordova.plugins.email.open

 

thanks,

RK.

 

Tags (2)
0 Kudos
11 Replies
Rakshith_K_Intel
Employee
148 Views

Which plugin are you using?

Here is simple example:

add this as third-party plugin via git url: https://github.com/katzer/cordova-plugin-email-composer

<script>
function email(){
    cordova.plugins.email.open({
        to:      'youremail@gmail.com',
        subject: 'Greetings',
        body:    'Hello How are you?'
    });
}        
</script>

 <button onclick="email()">Email</button>

 

more documentation here:https://github.com/katzer/cordova-plugin-email-composer

you have to build the app and install on device to test, this code works on ios and android

Raj_Kumar
Novice
148 Views

Rakshith,

First of all , I thank for responding to my problem.

I have copy pasted your code and added the same plugin in and its not working, I am trying to test this functionality using Intel App Preview app and its not working their and do you suggest any other approach to test this functionality, please advise.

Its critical now and appreciate your quick response.

 

Thanks,

RK

 

PaulF_IntelCorp
Employee
148 Views

Raf -- you cannot test code that uses third-party plugins in App Preview, you need to build the app or use the Debug tab and let it build a custom debug module for you.

Raj_Kumar
Novice
148 Views

Paul,

I have started configuring application and started testing in debug mode and I am getting the below error

TypeError: undefined is not an object (evaluating 'cordova.plugins.email')

Can you please help me and this is something urgent for me to complete some prototype.

Thanks,

Raj.

 

PaulF_IntelCorp
Employee
148 Views

You need to use the DEBUG TAB to debug an app that includes third-party apps. The Emulate tab and Test tab will not work for that debugging. See this doc page > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview

Raj_Kumar
Novice
148 Views

Yes please, I am using Debug Tab and I am not successful in enabling the capability of sending email can you please advise how to troubleshoot this, this is something urgent for my prototype.

 

Thanks

Raj.

Raj_Kumar
Novice
148 Views

I have created the build and deployed then its working , but this is not working in debug tab.

Can you please advise if there is any alternative option not to open email composer and I was looking for functionality to send email with out end user intervention to hit send button again..

Thanks,

Raj.

PaulF_IntelCorp
Employee
148 Views

Raj -- there are other debug options, it's possible the debug module is not working for this plugin. The most accurate debug option is to build an app and use the "debuggable" equals "true" option when you build the app. See this for additional details > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview#RemoteChromeDevTools

Daniele_A_
Beginner
148 Views

Paul..sorry.. i have the same problem seems... device block plugin .. i need to add at whitelist?

If yes...how ? I read a intel giudeline..but i ask if you can write a string to allow this plugin in the whitelist...

PaulF_IntelCorp
Employee
148 Views

Daniele -- sorry, but we are not experts on all the third-party plugins out there. I recommend you try using the Debug tab or a built app with "debuggable" set to "true" -- as described in the posts above -- to debug this issue. I highly recommend you start with the examples provided by the plugin author as a starting point. Sometimes it is something as simple as a misplaced comma or quote character.

Daniele_A_
Beginner
148 Views

 i use email-composer and debug but return  error...  in fn function... i don't know why...

i try to understand..!

 

Update >> I solve with this plugin /SocialSharing-PhoneGap-Plugin

Fantastic !!! Thx

 

Reply