Johnny7459624
Posts: 0
Joined: Tue Mar 31, 2015 7:49 am

Listitem in sendgrid email

Hi there

I want to show the list that user created in email body. I done the tutorial of the todo app. Now I want to show it in email body.

For example: I created 5 todo things and I want to share it via mail with my wife. Now that 5 todo things are listed in email body.

"Only the list of the current user."

Image

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

Listitem in sendgrid email

Hello Johnny,

It is better to use storage variables for sending data via email, instead of UI components. So you have to create string variable with all array's items, then sent it via email

Johnny7459624
Posts: 0
Joined: Tue Mar 31, 2015 7:49 am

Listitem in sendgrid email

ok cool, i did add it like it is in User registration example.

See my image. How do i implement it in the body.

Thank you Image

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

Listitem in sendgrid email

Hi Johnny,

Please use following JS code in JS section of this link:

pre

//Note: you need to replace "dogsStorage" with your storage name.
var someStorage = Apperyio.storage.dogsStorage.get();

var storageText = JSON.stringify(someStorage);

return "JSON value for the items = " + storageText;

/pre

Regards.

Johnny7459624
Posts: 0
Joined: Tue Mar 31, 2015 7:49 am

Listitem in sendgrid email

thank you very much for your help!

Johnny7459624
Posts: 0
Joined: Tue Mar 31, 2015 7:49 am

Listitem in sendgrid email

I tried it like in screenshot but email get error:

Tried:
Image

Error:
Image

if i remove that code email send.

Johnny7459624
Posts: 0
Joined: Tue Mar 31, 2015 7:49 am

Listitem in sendgrid email

Think found the problem but can you help me with it. I let it output in text box to see result.

Image

Johnny7459624
Posts: 0
Joined: Tue Mar 31, 2015 7:49 am

Listitem in sendgrid email

Hi any luck with this?

Johnny7459624
Posts: 0
Joined: Tue Mar 31, 2015 7:49 am

Listitem in sendgrid email

I tried this but not working.

Please help.

Code: Select all

 
 var output = '';  
var objectFromLS = JSON.parse(localStorage.getItem('stuffList')); for (var key in objectFromLS) { if (objectFromLS.hasOwnProperty(key)) { output = output+(key + ': ' +objectFromLS[key])+'\n'; } } Appery('txttoets').val(output);
Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Listitem in sendgrid email

Hello Johnny,

Could you check errors in the console? Please use:
preoutput = output+key + ':' +objectFromLS[key]+'\n';/pre
instead of:
preoutput = output+(key + ':
' +objectFromLS[key])+'\n';/pre

Return to “Issues”