• Hey,

    Well I wrote in the past, but still notifications don’t work for me.
    Also I’ve built a form using a single image field and then a repeater field with an image field in it.
    But it randomly fails – always there is at least one image missing. Either the “logo” or one of the images in the repeater field.

    best regards,
    Jonathan

    PS: e-Mails work fine with other plugins as well as themes

    • This topic was modified 6 years, 11 months ago by mjHollerATme.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mjHollerATme

    (@mjholleratme)

    Okay, now when I use the handle function, I get warnings.

    function handle_form_submission( $form, $fields, $args ) {
        
        print_r($fields);
        
        $email = af_get_field( 'email' );
    	$empfaenger = '[email protected]';
    	$betreff = 'Der Betreff';
    	$nachricht = 'Hallo';
    	$header = 'From: [email protected]' . "\r\n" .
    	    'Reply-To: [email protected]' . "\r\n" .
    	    'X-Mailer: PHP/' . phpversion();
    	
    	mail($empfaenger, $betreff, $nachricht, $header);
        
    }
    add_action( 'af/form/submission', 'handle_form_submission' );

    Warning: Missing argument 2 for handle_form_submission(), called in /www/htdocs/w00cbd80/akteure-der-region/wp-includes/class-wp-hook.php on line 288 and defined in /www/htdocs/w00cbd80/akteure-der-region/wp-content/themes/akteuretheme/functions.php on line 15

    Warning: Missing argument 3 for handle_form_submission(), called in /www/htdocs/w00cbd80/akteure-der-region/wp-includes/class-wp-hook.php on line 288 and defined in /www/htdocs/w00cbd80/akteure-der-region/wp-content/themes/akteuretheme/functions.php on line 15

    dickprovoost

    (@dickprovoosthotmailcom)

    I receive the same warnings although the code inside the function executes well.

    Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi!

    Regarding the warnings you are getting I think it’s because you need to specify the amount of arguments your hook takes. Something like: add_action( 'af/form/submission', 'handle_form_submission', 10, 3 );. I realize now that this is missing from the documentation, will add it soon!

    I just tried setting up a form with some image fields, both individual and in repeaters, but I unfortunately didn’t run into the same issues as you. My images were properly uploaded and included in the email. Could you check your uploads directory and see if your images are uploaded on form submission? Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Notifications still not working + missing images’ is closed to new replies.