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 Developer
rajvardhan
Posts: 7
Registered: ‎01-13-2013
My Device: Curve 9350
Accepted Solution

How to send email from BB10 webworks app

I want to have a module in my BB10 WebWorks app that will allow users to compose a message by entering details into a Form, which will then be sent via email to a desired email address. 

I suppose this might be done using the EmailComposerOptions API, but I am not sure on how to use it.

 

Any help will be appreciated.

 

 

Retired
mimendoza
Posts: 64
Registered: ‎06-04-2012
My Device: Blackberry Z10

Re: How to send email from BB10 webworks app

Have you looked at the sample code found in the API document?

https://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>

 Once the function is called, the email composer card will slide into view with any prepopulated fields and the user can then click send.

----------------------------------------------------------------------------------
- Did this post help solve the issue? Click on "Accept as Solution"
- Was the content of this post helpful? Please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Developer
kamal_nigam
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10

Re: How to send email from BB10 webworks app

Do we have native BB plugin support for this??

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Retired
mimendoza
Posts: 64
Registered: ‎06-04-2012
My Device: Blackberry Z10

Re: How to send email from BB10 webworks app

Once the above API is used in your WebWorks app, the SDK will take care of presenting the native Email card to the user.
----------------------------------------------------------------------------------
- Did this post help solve the issue? Click on "Accept as Solution"
- Was the content of this post helpful? Please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Developer
kamal_nigam
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10

Re: How to send email from BB10 webworks app

does it close the email screen automatically once it sent the email or to do this do we need to change in the parameter

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Retired
mimendoza
Posts: 64
Registered: ‎06-04-2012
My Device: Blackberry Z10

Re: How to send email from BB10 webworks app

The user will have to confirm the sending of the email, by clicking on the "Send" button, after the user has done this, the email composer will slide out of view and the user will see your app screen.

----------------------------------------------------------------------------------
- Did this post help solve the issue? Click on "Accept as Solution"
- Was the content of this post helpful? Please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
New Developer
johnbiiibs
Posts: 7
Registered: ‎10-29-2011
My Device: BlackBerry Torch 9800

Re: How to send email from BB10 webworks app

Is there no way to send an email using BlackBerry Webworks without the Invocation card? I mean directly send the email from within the app?