Page 1 of 2
Suggest easiest way to e-mail
Posted: Tue Jan 27, 2015 5:01 am
by Vinny B
Hello:
Code: Select all
I am generating a list using a query service. I need to e-mail the list using sendgrid. The problem is when I map it to the text field in send grid it only sends the label name. I need it to send the entire list.
or should I use server code?
Thank You
Vinny
Suggest easiest way to e-mail
Posted: Tue Jan 27, 2015 5:16 am
by Yurii Orishchuk
Hi Vinny,
You can click "JS" on the text request field nad get all needed information from you list and return it.
Easy way(without format is to use following JS code:
pre
var list = Apperyio("listName");
return list.text();
/pre
Regards.
Suggest easiest way to e-mail
Posted: Tue Jan 27, 2015 12:12 pm
by Vinny B
that worked excellent. if I wanted to added a little formatting for example the e-mail generates alot of spaces between each line. If I can remove those spaces that would be great.
Thank Yurii
Appreciate it alot
Suggest easiest way to e-mail
Posted: Tue Jan 27, 2015 3:33 pm
by Vinny B
the formatting i wanted to add would basically be a list with two columns. But when i add a grid to the list, the e-mail wont work
NAME OF PRODUCT
product1 qty
product2 qty
product3 qty
Thank You
Suggest easiest way to e-mail
Posted: Tue Jan 27, 2015 3:58 pm
by M&M
Have a look at this code (Courtesy : Mr. Yurii )
This basically loops the list item...and read / console log the contents
var list = Appery("mobilelist_33");
var listItems = list.find("li");
for(var i = 0; i < listItems.length; i++){
//Do with items what you need.
console.log("listItems[" + i + "] = " + jQuery(listItems).text().trim());
};
//Logout items count.
console.log("listItems.length = " + listItems.length);
Mess with it...throw the contents out as text / string...and use that text in your email (or report)
Suggest easiest way to e-mail
Posted: Tue Jan 27, 2015 4:24 pm
by Vinny B
Suggest easiest way to e-mail
Posted: Wed Jan 28, 2015 2:46 am
by Vinny B
Still having trouble. Any other ideas
Suggest easiest way to e-mail
Posted: Wed Jan 28, 2015 4:37 am
by M&M
And what exactly is the trouble? Formatting? Sending email?
Suggest easiest way to e-mail
Posted: Wed Jan 28, 2015 9:22 am
by Vinny B
the email puts several lines of blanks spaces between each result. it owuld also be nice if the number was on the same line as the business name.
Suggest easiest way to e-mail
Posted: Wed Jan 28, 2015 9:58 am
by M&M
Have you tried some hard coded text or something? At least it will narrow down whether it is during the content generation that the extra lines appear, or whether it is the styling or something