{exp:shortlist:lists cache="no"} {exp:formgrab:form name="customer_quotes" title="Customer Quotes"} <input type=”text” id=”menber-name” name=”member-name” size=”40” maxlength=”35” placeholder=”Your Name”/>
<input type="text" id="member-email" name="member-email" size="40" maxlength="35" placeholder="Your Email" />
<textarea id="delivery" name="delivery" placeholder="Delivery Adress For Quote" rows="3"></textarea>
{items}
<input type=”text” name="product{entry_id}" id="product{entry_id}" value="{title}" placeholder="{title}">
<input 20px; margin-bottom: 25px;" type=”text” name="product_info{entry_id}" id="product_info{entry_id}" value="" placeholder="Information about your requirements. Qty, Dimensions,">
{/items}
<input name="submit" type='submit' value='Submit Form' />
{/exp:formgrab:form} {/exp:shortlist:lists}
As you can see what I am doing is using the id of entry id to make sure that a new field is uniquely generated for each item that the user has selected within shortlist. This seems to be working and entries are showing in the backend formgrab correctly.
The question I have is can all this be sent using the Email body. An {email_all_fields} feature or something like that.
I have enabled email notification on formgrab and can generate an email with
{member-name} {member-email} {delivery}
all working perfectly.
The problem is generating the email for the items which the user selects.
It will work when for example I pick the item with id 141 if I have in the Email Body Section.
{Product141} {Product_info141}
The email will work perfectly but obviously I don’t know which of the items the user will pick.
I have tried to do this using freeform and the built in email function before trying FormGrab. Through my testing FormGrab seems to be the only one that works a bit.
Thanks in advance to anyone who can help.
I don’t think Formgrab has a email_all_fields
function.
My first thought would be to have the Shortlist fields in a separate form (to prevent Formgrab grabbing the data). What you’d then do is use some Javascript to write shortlist field info to a hidden Formgrab textarea field.
Another approach would be to use Channel Form and save submissions as entries, you’d use a Grid field for the “items” data.
Have you seen https://addons.reinos.nl/simple-cart ? It’s a basic shopping cart without the payment stage. That would allow you to collect items info as “products” - what you then do with the “cart” bit is find a way to email the items to wherever, or even save them as a channel entry. A bonus with this one is that you can calculate price totals!
Thanks for your reply Rob Allen.
I managed to get it working by adding a javascript incremental counter to each product item listed with shortlist then in the form grab I have just named them with numbers going up high. This works the only con is that I have extra random tags at the end of an email as it is impossible to guess how many products a customer will add to their quote.
It is a bit of a hack but at least it works despite the random tags.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.