Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Suggest easiest way to e-mail

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

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

Suggest easiest way to e-mail

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.

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Suggest easiest way to e-mail

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

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Suggest easiest way to e-mail

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

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Suggest easiest way to e-mail

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)

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Suggest easiest way to e-mail

ok thanks

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Suggest easiest way to e-mail

Still having trouble. Any other ideas

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Suggest easiest way to e-mail

And what exactly is the trouble? Formatting? Sending email?

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Suggest easiest way to e-mail

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.

Image

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Suggest easiest way to e-mail

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

Return to “Issues”