Bootstrap and Angular.JS - send email button

This forum contains topics that were moved from Get Satisfaction
jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

Bootstrap and Angular.JS - send email button

Post 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

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

Bootstrap and Angular.JS - send email button

Post by jmd2004 »

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

Bootstrap and Angular.JS - send email button

Post by jmd2004 »

Any help would be greatly appreciated!

Serhii Kulibaba
Posts: 147
Joined: Tue Aug 27, 2013 1:47 pm

Bootstrap and Angular.JS - send email button

Post by Serhii Kulibaba »

Hello,

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

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

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

Bootstrap and Angular.JS - send email button

Post 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?

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

Bootstrap and Angular.JS - send email button

Post by jmd2004 »

any advise would be greatly appreciated!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Bootstrap and Angular.JS - send email button

Post 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.

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

Bootstrap and Angular.JS - send email button

Post 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?

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

Bootstrap and Angular.JS - send email button

Post 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?

jmd2004
Posts: 1
Joined: Wed Jan 28, 2015 7:06 pm

Bootstrap and Angular.JS - send email button

Post by jmd2004 »

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

Post Reply