Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Martin226
Posts: 4
Registered: ‎09-11-2013
My Device: Z10 / Q10

Send an Email from App in background

Hi all,

 

i have programmed an app where the user have to fill out a form and when the form is filled out the user should be able to send the form via email.

 

I have found that, but I really don't know how to use it.. is there any tuturial or maybe someone could help me?

 

blackberry.invoke.card.invokeEmailComposer();
Developer
PawelGorny
Posts: 150
Registered: ‎12-03-2012
My Device: PP

Re: Send an Email from App in background


Martin226 wrote:

Hi all,

 

i have programmed an app where the user have to fill out a form and when the form is filled out the user should be able to send the form via email.

 

I have found that, but I really don't know how to use it.. is there any tuturial or maybe someone could help me?

 

blackberry.invoke.card.invokeEmailComposer();

http://developer.blackberry.com/html5/apis/blackberry.invoke.card.emailcomposeroptions.html

http://developer.blackberry.com/html5/apis/blackberry.invoke.card.html#.invokeEmailComposer

 

< script="text/javascript">
//simply invoke email composer, with no options and callbacks
blackberry.invoke.card.invokeEmailComposer();

//invoke email composer with subject, body, to, cc and attachment options
blackberry.invoke.card.invokeEmailComposer({
    subject: "Email subject",
    body: "Email body",
    to: ["a@a.ca", "b@b.com"],
    cc: ["c@c.ca, d@d.com"],
    attachment: ["/path/to/an/attachment.txt", "path/to/another/attachment.txt"]
}, function (done) {
    console.log(done);
}, function (cancel) {
    console.log(cancel)
}, function (invokeError) {
    console.log(invokeError);
});
</script>

 

 

--
Regards,
Pawel Gorny
my apps: http://pawelgorny.com/
PGpgp, Your Reply, Anagrammatist, Texas Hold'em Odds Calculator, Contacts to CSV
If your issue has been solved, please resolve it by marking "Accept as Solution"
New Contributor
Martin226
Posts: 4
Registered: ‎09-11-2013
My Device: Z10 / Q10

Re: Send an Email from App in background

Thanks for replay, but how do I use this?

 

I have the following:

in the index.html:

<button type="button" id="btnSubmit" onClick="sendMail()">Abschicken</button>

 

 

 

and in the .js file:

function sendMail()
{
blackberry.invoke.card.invokeEmailComposer({
    subject: "Email subject",
    body: "Email body",
    to: ["m.jonek@gedako.de"],
}, function (done) {
    console.log(done);
}, function (cancel) {
    console.log(cancel)
}, function (invokeError) {
    console.log(invokeError);
});

}

 

 

But there is happening nothing :/

Developer
PawelGorny
Posts: 150
Registered: ‎12-03-2012
My Device: PP

Re: Send an Email from App in background

Did you load all the needed WebWorks libraries?

 

https://developer.blackberry.com/html5/documentation/using_webworks_apis.html

 

<script src="local:///chrome/webworks.js"></script>

 

--
Regards,
Pawel Gorny
my apps: http://pawelgorny.com/
PGpgp, Your Reply, Anagrammatist, Texas Hold'em Odds Calculator, Contacts to CSV
If your issue has been solved, please resolve it by marking "Accept as Solution"
New Contributor
Martin226
Posts: 4
Registered: ‎09-11-2013
My Device: Z10 / Q10

Re: Send an Email from App in background

No I haven't.
It seems I have to read some more :smileyhappy:
Thank you, for first :smileyhappy: