Heres my problem:
I'm trying to combine the Warehouse Manager (from the tutorial) with the SendGrid API, so that the collected information (Scanned article, quantity and username, 3 different fields) get pasted into the text area of the Email. However, when I map all 3 infos to the text area, only the last one goes into the email. I hope I described my problem well enough and thanks in advance.
Heres my problem:
Thanks, I got it to work halfway now, except that I get "undefined" instead of my Values. I've mapped 2 of my component to localstorage variables and added the following lines to my "text" component:
var fullText = localStorage.articlecode + " " + localStorage.qty + " " + value;
what am I missing here?
Great! Thank you for sharing.
Hi, so while my requested function is still working, my app sometimes adds an "\n" to the end of my scanned Barcode when I send out my email. For example, instead of
"Username" "Barcode123" Quantity123
"Username" "Barcode123\n" Quantity123
in my generated email. It also happens very inconsistently. Any ideas how I can resolve this?
After a bit of searching I found out that \n means next line in JS, but I can't happen to find it in any of the codes that I'm using.
So you just need to add some fields to your app UI and then use these fields to make body of your message.
In this case you need:
1 Add needed fields to the APP.
2 Open "Before send" mapping for sendgrid service datasource.
3 Find needed parameter for example body.
4 Click "JS" button on this parameter(to add JS code).
5 Populate it with JS code code like:
//Where "firstNameName" is a goal field name.
var firstName = Apperyio("firstNameName");
//Where "secondNameName" is a goal field name.
var secondName = Apperyio("secondNameName");
var goalStringToReturn = "Hello " + firstName + " " + secondName ;
This is a simple example that describes how you can use all fields that you need and combine them into single string..
Thanks for the response Yurii,
However, when I try your method the email body turns into this:
[object Object] [object Object] [object Object]
I went back to
var fullText = localStorage.Username1 + " " + localStorage.Artikel + " " + value;
and figured out the \n only appears if my scanned barcode is longer than one line in the text box of my app. Still trying to figure out to get rid of it though.