How do I create a Meteor.js contact form with hidden fields

283 views Asked by At

I really cannot figure out how to get a contact form into my Meteor app that sends an email. It needs to be able to draw information such as session variables and user email, then send it, preferably with Mailgun API to an email account.

I've tried to follow tutorials or similar questions on here, and of course read documentation, but for something seemingly so simple, I've gotten out of my depths. And yeah, as you probably realised, I'm pretty beginner at this so...!

1

There are 1 answers

1
Rafael Quintanilha On

I'm not quite sure if I got your question, but if you want to add hidden fields to your forms, just add a type="hidden" option to your afFieldInput template.

{{#autoForm schema="mySchema" id="myContactForm" type="normal"}}
   {{> afFieldInput name='email' type='hidden'}}
   ...
{{/autoform}}

There's an example in the official docs that handles a contact form (though without hidden fields).