hypery2k / cordova-email-plugin

Edit and send email messages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

needs a success callback

rolinger opened this issue · comments

This has a feature to let you know if the user cancelled the email, but what about a success call back that says the email was actually sent? Is there anyway to determine that?

Reason: in my app email form, I need to know if the email was sent so I can post a message "Email Sent" and then clear out the form. Currently, the email sends and drops the user back into my app on the form that doesn't appear to have sent.

Something like:
cordova.plugins.email.open(preferences,success,fail) ;

or:

cordova.plugins.email.open({
   to: [addresses],
   subject: "blah"
   body: "more blah",
   isHtml: 0,
   success: externalSuccess();
}, function() { console.log("Email Cancelled")}

Is there already a solution for this?

What is the this in:

cordova.plugins.email.open(properties, function () {
    console.log('email view dismissed');
}, this);

thanks for the feature suggestions. Have to check this. But currently working on other stuff. So not sure when I've time to add it.
with the this you can shift the scope for the this within javascript. Normally not really needed ;)

@hypery2k Can you elaborate on your comment:

with the this you can shift the scope for the this within javascript. Normally not really needed ;)

you can shift the context of the callback call by providing it to the plugin