Page 1 of 3

Bootstrap and Angular.JS - send email button

Posted: Mon Aug 10, 2015 1:49 pm
by jmd2004

Hi I'm trying to send an email via a button. Any help would be greatly appreciated!

// Function code
var my_agent_id = "12345678";
var email = "a href="mailto:test@acme_email.com" rel="nofollow"test@acme_email.com/a";

window.location.href = "mailto:" + email + "?subject=" + my_agent_id;

Image


Bootstrap and Angular.JS - send email button

Posted: Mon Aug 10, 2015 1:51 pm
by jmd2004

Bootstrap and Angular.JS - send email button

Posted: Tue Aug 11, 2015 1:10 pm
by jmd2004

Any help would be greatly appreciated!


Bootstrap and Angular.JS - send email button

Posted: Tue Aug 11, 2015 7:13 pm
by Serhii Kulibaba

Hello,

Please follow this tutorial: https://devcenter.appery.io/documenta...

You can use the same service for sending emails (sendgrid)


Bootstrap and Angular.JS - send email button

Posted: Wed Aug 12, 2015 12:24 am
by jmd2004

that looks like a jquery tutorial. Any info for bootstrap/angular?

I asked about email, but i'm specifically interested in how to run javascript functions

for example in jquery the following works

var my_phone = localStorage.getItem("phone");
var my_agent_id = localStorage.getItem("agent_id");
var my_wait_to_callback = Appery("callback_input_promise_time").val();

$.get( "[url=https://acme_test.com/do/Spawn.aspx]https://acme_test.com/do/Spawn.aspx[/url]", { scriptName: "test_script", bus_no: "1101", scriptID:"12345", skill_no: "4567", p1: "click_to_dial", p2: my_phone , p3: my_agent_id, p4: "not_now", p5: my_wait_to_callback, Guid: "xxxx"} );

How would i run this javascript in angular/bootstrap?


Bootstrap and Angular.JS - send email button

Posted: Thu Aug 13, 2015 7:32 pm
by jmd2004

any advise would be greatly appreciated!


Bootstrap and Angular.JS - send email button

Posted: Mon Aug 17, 2015 4:48 am
by Yurii Orishchuk

Hello,

In common way to run JS function in angular you need:

1 specify function in scope.
Details: http://prntscr.com/85f240/direct

2 invoke this function on some event.. For example for button click you can activate this component then add "ng-click" attribute with value "yourFunction()"
Details: http://prntscr.com/85f2z9/direct

Regards.


Bootstrap and Angular.JS - send email button

Posted: Mon Aug 17, 2015 7:33 pm
by jmd2004

Hi Yurri,

It worked! Thanks for your advise on how to execute the java script function.

My Function to send an email opened my email client as expected.
// Function code

var my_agent_id = "12345678";
var email = "a href="mailto:test2@test_email.com" rel="nofollow"test2@test_email.com/a";

window.location.href = "mailto:" + email + "?subject=" + my_agent_id;

I tried a 2nd function but i think it uses jquey. Do I need to use just javascript in the functions or can I use a 3rd party lib like jquery?


Bootstrap and Angular.JS - send email button

Posted: Thu Aug 20, 2015 7:16 pm
by jmd2004

how would i do an http get request

$.get("https://home-server.com/form/submit.aspx", {
script: "dial_phone",
bus_no: "123456",
scriptID: "111",
skill_no: "18",
p1: "dial",
p2: "xxxxxxxxxx",
p3: "id",
p4: "not_now",
p5: "my_wait_to_callback",
Guid: "guid"
});

The above code works in the query mobile app that i built using appery.io. How can i use the same code with an angular/bootstrap app? can i import a jquery library?


Bootstrap and Angular.JS - send email button

Posted: Tue Aug 25, 2015 4:43 pm
by jmd2004

Can i use a jquery for the above or do i need to use pure javascript?