Support » Plugins » Contact Form 7: how to include PHP variable in message

  • wnpaul

    (@wnpaul)


    Hello,

    I have a need to include a $_REQUEST variable in the output from Contact-Form-7 but cannot figure out how to get into the mail message.

    Is there some way to quote the variable in such a way that interpretation is delayed until the message is actually being put together?

    Here is a fairly detailed description of what i am trying to do:

    I have a directory of churches which is displayed using a custom page template. Each entry has a link to a page containing a Contact-Form-7 form in order to submit corrections to the information in the entry. I need to somehow include the entry number in the mail message being sent. I can append it to the link calling the form like so, “/form-page/?id=123”, and it is then available on the page containing the form, but how do I then stick $_REQUEST[‘id’] into the form (which is not defined in that page, but in the admin interface). I guess there might be some way of creating a variable which would be available to the form if quoted (in the form definition) in some particular way, but I can’t figure it out.

    Of course I could build my own php form and mail sending code but it would be more generally useful to figure out how to include variable data in a Contact-Form-7 form/message.

    Thanks for any and all hints.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Contact Form 7: how to include PHP variable in message’ is closed to new replies.