Page 1 of 1

Send form via SendGrid (Not just default values)

Posted: Mon Jul 21, 2014 9:56 am
by Nathan Ford

I want to send a form via email. I have SendGrid set up and all the fields going into the relevant request parameters, however when the email is sent, it still only sends the default fields (Message, Subject, To and From). How do I map the other fields so that they display when the email is sent? Thanks.


Send form via SendGrid (Not just default values)

Posted: Mon Jul 21, 2014 11:49 am
by Kateryna Grynko

Hi Nathan,

Please see SendGrid API here:
https://sendgrid.com/docs/API_Referen...

If you need to send data from several fields then generate an email body from needed data and send it.


Send form via SendGrid (Not just default values)

Posted: Mon Jul 21, 2014 12:30 pm
by Nathan Ford

Thanks for this.

Also if I wanted to combine two fields to make one before the email is sent, would this be possible on your platform?

For instance, a Firstname and a Surname field combining to make a full name field.


Send form via SendGrid (Not just default values)

Posted: Mon Jul 21, 2014 1:07 pm
by Nathan Ford

More specifically it is for a report a repair form, the fields are:

First Name
Surname

Repair Type
Repair Details
Photo of Repair (if possible)

First line of Address
Postcode

Up to date telephone number
Email Address


Send form via SendGrid (Not just default values)

Posted: Mon Jul 21, 2014 2:11 pm
by Evgene Karachevtsev

Hello Nathan,

You can combine any number of fields with any static text. You should use js code in the mapping for this. You may read more here http://devcenter.appery.io/documentat...


Send form via SendGrid (Not just default values)

Posted: Tue Jul 22, 2014 9:30 am
by Nathan Ford

Thanks again.

Another question... :)

After following this tutorial:

http://devcenter.appery.io/documentat...

I was wondering if their was a way to do the 'Set to local storage' from a 'textarea' input, through JSCode.

Thanks

ps i may just be being dense, and it may be on that tutorial :s


Send form via SendGrid (Not just default values)

Posted: Tue Jul 22, 2014 11:01 am
by Nathan Ford

This is what I have so far:

localStorage.setItem('firstname',"bob");
var a = localStorage.getItem('firstname');
Appery("dud").text (a);

Which sets the local storage 'firstname' to "bob". Then calls the first name from local storage and then changes a label ('dud') to say "bob". However I have a field called fname, where a user can enter in their firstname and I want that to be stored in the local storage. I have tried:

localStorage.setItem('firstname', Appery(fname));

and

localStorage.setItem('firstname', Appery('fname'));

But neither work, what is the correct syntax? (If it is possible. Thanks :))


Send form via SendGrid (Not just default values)

Posted: Tue Jul 22, 2014 2:25 pm
by Evgene Karachevtsev

Hello Nathan,

Could you please try this code:
prelocalStorage.setItem('firstname', Appery('fname').val());/pre


Send form via SendGrid (Not just default values)

Posted: Tue Jul 22, 2014 3:41 pm
by Nathan Ford

I got it working now, but thanks for your repsonse :)