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
Contributor
Posts: 33
Registered: ‎01-17-2013
My Device: BB10 Dev Alpha Sim
My Carrier: Verizon

Opening Email Client on BB10

So it seems the BB10 dev alpha simulator does not have an email client.

I have search around, and believe i have the correct code to invoke it, but i want to be sure before i submit my app.

 

This is the code im using (This is a javascript/html5 app)

 

sendBlackBerryEmail: function(subject, body, to) {
		blackberry.invoke.card.invokeEmailComposer({
			subject: subject,
			body: body,
			to: to
		}, function (done) {
			console.log(done);
		}, function (cancel) {
			console.log(cancel);
		}, function (invokeError) {
			console.log(invokeError);
		});
	},

 So is this the correct way?

Contributor
Posts: 16
Registered: ‎08-27-2011
My Device: Curve9300, PlayBook
My Carrier: SFR

Re: Opening Email Client on BB10

Javascript is not a typed language, depending on parameter types when you call 

function(subject, body, to)

 

it may work and may not. I used the following in my app (not approved yet). Hope this helps:

		blackberry.invoke.card.invokeEmailComposer({
			subject: "this subject is a string",
			body: "body is a text string",
			to: ["emailRecipientsIsAArrayEvenItHasOnlyOneElement@hotmail.com"]
		}, function (done) {
			console.log(done);
		}, function (cancel) {
			console.log(cancel);
		}, function (invokeError) {
			console.log(invokeError);
		});

 

 

Contributor
Posts: 33
Registered: ‎01-17-2013
My Device: BB10 Dev Alpha Sim
My Carrier: Verizon

Re: Opening Email Client on BB10

Cool, i am passing in vars of the right type.

So i will send it off and update it later if it doesn't work.
Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Opening Email Client on BB10

just make sure the "to" is an array of strings, not just a string :smileyhappy:

Nuno