Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hello, I'm building my 3rd site now with couch and I'm still exited. But new sites new questions - and maybe there is an easy way. Is it possible to get some of the data of a contact form like the name or inquiry dates into the mail subject?

Thank you very much!
Hi,

As explained at http://www.couchcms.com/docs/concepts/forms.html,
submitted values of all the fields in the form are available in the success case as variables of the same names prepended by 'frm_'. So, for example, if the form had two fields 'name' and 'email' Couch will make available the values submitted through them as variables named 'frm_name' and 'frm_email'.

It should be easy now to see how to use the submitted values in the 'subject' of the email. Following is a portion of a form doing so (don't forget to use double-quotes with the parameter where the variables are being show).
Code: Select all
<cms:if k_success >
   <h3>Thanks for your submission. We'll get back to you.</h3>
   <cms:send_mail from='abc@somemail.com' to='xyz@somemail.com' subject="Feedback from <cms:show frm_name /> (<cms:show frm_email />)">
      The following is an email sent by a visitor to your site:
      <cms:show k_success />
   </cms:send_mail>
</cms:if>

Hope this helps.
yes, this is a lot of help this works great! Thank you very much. I was searching the documentation and the forum for mail subject - looks like I searched at the wrong places
3 posts Page 1 of 1