Issues with cordova-plugin-email-composer

having issues with the cordova-plugin-email-composer plugin.

I am able to get the email to be created on IOS, but i am unable to get the to field, or the body field to be populated. Only the subject field it populated.

Here is my function to create the email message

$scope.sendFeedback= function() {
if(window.plugins && window.plugins.emailComposer) {
window.plugins.emailComposer.showEmailComposerWithCallback(function(result) {
console.log(“emai completed”);
},

        "contact via app", // Subject
        "<h2>Hello Test Email</h2>",             // Body
        ["test@gmail.com","test@test.com"],    // To
        null,                    // CC
        null,                    // BCC
        true,                   // isHTML
        null,                    // Attachments
        null);                   // Attachment Data
    }

}

would appreciate any insight as to why the email is not be populated correctly

Thanks

so i figured it out, the about code does work, but only on device not in simulator. the mail window does open in simulator but the fields are not populated.

@digitalsleep could you elaborate on your installation and controller setup?

I’m using $cordovaEmailComposer and despite things saying they’re loaded, nothing happens when I call .open():

   $scope.composeEmail = function(){
     $cordovaEmailComposer.open(email).then(null, function () {
          // user cancelled email
          console.log('user cancelled email');
        });
   };

I’ve tried wrapping this in a:

 document.addEventListener('deviceready', function () {}

and in:

  $ionicPlatform.ready(function(){
    window.plugin.email.isAvailable()
 }

to no avail.

Thanks in advance!

Hey Sakotturi,

Thanks for reaching out, I really not sure what was the issue, it just started working. :smile:

@digitalsleep its always great when that happens!

Do you mind sharing what you installed in what order and sharing the controller code that this works with? I must be missing some detail