• Resolved Ivo

    (@ivobirrer)


    Hi Folks

    Thank you for this awesome plugin!

    I was looking on how to get the Form Fields prefilled but did not succeed until I tried to use one of the pre-defined Variables like {CurUserLastName}. Great, this cannot only be use for the Mail but also to prefill the fields. Unfortunately the amount of pre-defined Variables is quite limited.

    What I would like to achieve is to grab as may fields of the logged in user as possible. Since I have WP-Members (other Plugins provide similar functionality) installed I have many more of such fields ?? Luckily these additional fields are stored in the Users Meta Data.

    I have figured out that I can add own CurrUser-Variables quite easily by adding more lines to the lib_aux.php, e.g.:

    $m 	= str_replace( '{CurUserLogin}',	$CurrUser->user_login, $m );
    $m 	= str_replace( '{CurUserStreet1}',	$CurrUser->addr1, $m );
    $m 	= str_replace( '{CurUserZip}',	$CurrUser->zip, $m );
    $m 	= str_replace( '{CurUserCity}',	$CurrUser->city, $m );
    $m 	= str_replace( '{CurUserTelefon}',	$CurrUser->telefon, $m );
    $m 	= str_replace( '{CurUserMobile}',	$CurrUser->mobile, $m );

    Now I am a bit afraid that I will lose this with the next update. Is there any chance you guys provide the possibility to set up such Variables in e.g. Global- or Form-Settings or in a dedicated File that will be hooked into lib_aux.php?

    Thanks a lot for your efforts.

    Brgds
    Ivo

    https://www.ads-software.com/plugins/cforms2/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author bgermann

    (@bgermann)

    Maybe I will introduce a WordPress filter on the mails before sending them. Just watch the changelog in the upcoming versions.

    Plugin Author bgermann

    (@bgermann)

    Please have a look at the my_cforms_logic function in my-functions.php.txt, which can handle additional email text replacements. It is deprecated, but will survive for some while and when it is removed, there will be an alternative filter.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Own Variables’ is closed to new replies.