Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi guys!

Just a quick question. Is it possible to send an email containing the information submitted by a databound form on <cms:if k_success > ? It seems I can email only hardcoded content :(
Code: Select all
<cms:set submit_success="<cms:get_flash 'submit_success' />" />
              <cms:if submit_success >
                        <div class="alert-success"><p>Booking done.....</p></div>
              </cms:if>
       
      <cms:form
            masterpage='bookings.php'
            mode='create'
            enctype='multipart/form-data'
            method='post'
            anchor='0'
            ><cms:if k_success >
                <cms:db_persist_form
                    _invalidate_cache='0'
                    _auto_title='1'
                />
                <cms:send_mail from=k_email_from to=k_email_to subject='New booking from website'>
                     Information regarding the new booking should be displayed here
                         submitted input field 1 content ...........
                         submitted input field 2 content ...........
                </cms:send_mail>
                <cms:set_flash name='submit_success' value='1' />
      <cms:redirect k_page_link />
            </cms:if>
            ..............
            ..............
       </cms:form>
Code: Select all
It seems I can email only hardcoded content
Not at all!
You can use every single variable available to you at that point (and that includes the contents of the submitted form).

I hope you do recall that the variables containing values of the form fields have 'frm_' prepended. Perhaps this is what is stumping you?

I'd suggest you please place a <cms:dump_all /> in the success block (and do not redirect so as to be able to see all outputted variables). All the variables outputted may be used in the email.

Hope it helps.
KK wrote:
Code: Select all
It seems I can email only hardcoded content
Not at all!
You can use every single variable available to you at that point (and that includes the contents of the submitted form).

I hope you do recall that the variables containing values of the form fields have 'frm_' prepended. Perhaps this is what is stumping you?

I'd suggest you please place a <cms:dump_all /> in the success block (and do not redirect so as to be able to see all outputted variables). All the variables outputted may be used in the email.

Hope it helps.


Thank you KK! Problem solved :)
3 posts Page 1 of 1