• Resolved kiwikirsch

    (@kiwikirsch)


    Dear Community!
    I’m afraid to be an absolute beginner in coding :/ I do use a quiz to guard off spambots. I had soo much fun thinking of questions like “How many pushups can Chuck Norris perform?|all of them” and I’d just love to know which of those questions people did eventually have replied to without asking them ?? Just an issue of my own entertainment. I tried [text quiz …] and placed [your-quiz] into the email. This did place the question into the answer box instead of above. I am too new into codes to come up with IF or HOW I can include a ?this person said “all of them”? into the emails I’d receive. Is there a way and if so, how? Thank you so much.

Viewing 15 replies - 1 through 15 (of 15 total)
  • ciao @kiwikirsch

    if you create a custom quiz with [text quiz …] you need to use [quiz] in the mail template

    Thread Starter kiwikirsch

    (@kiwikirsch)

    ?[text quiz …] […] did place the question into the answer box instead of above?

    the “text” altered the entire appearance of the quiz itself. i confess to not have tried its further functionality after i saw this, as it didn’t accord to what i wanted it to look :/

    @kiwikirsch, maybe I explained it wrong, but I meant to insert [quiz] in the mail template (the second tab) to receive the user’s choice by mail

    Thread Starter kiwikirsch

    (@kiwikirsch)

    aah! i’ll try that!! i had tried to (wrongly?) observe/figure what would be required in the mail template and thought [your-quiz] would be it. i’ll try ??
    __

    nope. the email then just says [quiz] without using it as a variable for the content of individual quiz responses :/ tried it with “how does a gorilla ring your doorbell?|kingkong” and the email just says [quiz] instead of “kingkong”.

    you are right, the tag has an option that disable the mail publishing:

    https://github.com/takayukister/contact-form-7/blob/70b04ea38e23aae2947c45b0cf4a3c2d3371d24e/modules/quiz.php#L16

    In this case you would have to make your own tag (practically copying this file) but I don’t see any other way to make it easier!

    Thread Starter kiwikirsch

    (@kiwikirsch)

    good grief ??

    this can be a solution?

    place into functions.php ( tested only on my local env // don’t blame me )

    remove_action( 'wpcf7_init', 'wpcf7_add_form_tag_quiz', 10 );
    add_action( 'wpcf7_init', 'my_wpcf7_add_form_tag_quiz', 11, 0 );
    
    function my_wpcf7_add_form_tag_quiz() {
    	wpcf7_add_form_tag( 'quiz',
    		'wpcf7_quiz_form_tag_handler',
    		array(
    			'name-attr' => true,
    			'do-not-store' => true,
    			'not-for-mail' => false,
    		)
    	);
    }
    Thread Starter kiwikirsch

    (@kiwikirsch)

    awesome! i’ll try this ?? should [quiz] in the mail template then provide me the info i wanted? =D

    yes! and if you want to store also on flamingo the data captured you may want to change the line 'do-not-store' => false, with "do-not-store' => true,"

    Thread Starter kiwikirsch

    (@kiwikirsch)

    i’m so embarrassed ?? what did i mess up?

    ?Der Absender antwortete [quiz]?

    /**
     * Quiz response in mail template
     */
    remove_action( 'wpcf7_init', 'wpcf7_add_form_tag_quiz', 10 );
    add_action( 'wpcf7_init', 'my_wpcf7_add_form_tag_quiz', 11, 0 );
    
    function my_wpcf7_add_form_tag_quiz() {
    	wpcf7_add_form_tag( 'quiz',
    		'wpcf7_quiz_form_tag_handler',
    		array(
    			'name-attr' => true,
    			'do-not-store' => true,
    			'not-for-mail' => false,
    		)
    	);
    }
    Thread Starter kiwikirsch

    (@kiwikirsch)

    <p>Und weil Spambots keinen Humor haben:
    
    [quiz Huhu
    "Was ist rot und riecht nach blauer Farbe?|rote farbe"
    "Was sitzt auf dem Baum und klebt eine Collage? Das __|uhu"
    "Welcher Fisch ist der nervigste? Der __|st?r"
    "Wie hei?t der Boomerang, der nicht zurückkommt?|stock"
    "Wie klingelt ein Gorilla an der Tür?|king kong"
    "Wie nennt man ein helles Mammut?|hellmut"
    "Wieviele Liegestütz schafft Chuck Norris?|alle"]</p>

    (translates to ?and because spambots lack humour:?)

    i tried adding both
    Der Absender antwortete [quiz]
    and
    Der Absender antwortete [your-quiz]
    in the mail template,

    but the email contained exactly those, no replies. i feel like a moron. maaan. coding, cooking, knitting and crotcheting is the only things i fail in. i make and maintain and repair my own bikes, furniture, computers, clothes, electricity, water things, i do volunteer in a repair café.. this should be so simple, yet i fail. grrr.

    • This reply was modified 3 years, 6 months ago by kiwikirsch.

    come on @kiwikirsch don’t worry! it’s more easier than you think!

    You must use [Huhu] and not [quiz]! This is because you have given a custom name “Huhu” (and not your-quiz) to the “quiz” tag.

    Please read this carefully, it’s very clear and understandable:
    https://contactform7.com/tag-syntax/#mail_tag

    Thread Starter kiwikirsch

    (@kiwikirsch)

    YES!!!! YESS!!!!! THANK YOU!!!!!! marry me!!! ??

    for those who have humour with bots this and more! ??

    ps: please mark as solved because this can help others users who want to play pranks on bots!

    • This reply was modified 3 years, 6 months ago by Erik. Reason: adds "mark as solved please"
    Thread Starter kiwikirsch

    (@kiwikirsch)

    ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Quiz response contained in email?’ is closed to new replies.