Maaltijd-en-avondgebed

Samen eten

#Activiteit

Samen eten

Een keer per maand eten we samen op vrijdagavond. Met elkaar koken we en hebben we een shabbatviering.

/** * Connect the existing Elementor newsletter form * to the public Laposta subscription form. * * No Laposta API key is required. */ add_action( 'elementor_pro/forms/process', 'blr_send_elementor_subscription_to_laposta', 20, 2 ); function blr_send_elementor_subscription_to_laposta( $record, $ajax_handler ) { /* * Only process the newsletter form. * This must exactly match the Form Name in Elementor. */ $form_name = $record->get_form_settings( 'form_name' ); if ( 'Inschrijving nieuwsbrief' !== $form_name ) { return; } /* * Find the email field automatically. */ $fields = $record->get( 'fields' ); $email = ''; $email_field_id = 'name'; foreach ( $fields as $field_id => $field ) { if ( isset( $field['type'] ) && 'email' === $field['type'] ) { $email = sanitize_email( isset( $field['value'] ) ? $field['value'] : '' ); $email_field_id = $field_id; break; } } /* * Validate the email address. */ if ( ! is_email( $email ) ) { $ajax_handler->add_error( $email_field_id, 'Vul een geldig e-mailadres in.' ); return; } /* * Submit the email address to the public Laposta form. * * a = Laposta account/form identifier * l = Laposta list/form identifier * b8liUIKLM7 = Laposta email field * email = Laposta honeypot spam field, which must remain empty */ $response = wp_remote_post( 'https://bron-lachai-roi.email-provider.eu/subscribe/post/index.php', [ 'timeout' => 20, 'redirection' => 0, 'headers' => [ 'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8', ], 'body' => [ 'next' => '', 'a' => '10dnqadupj', 'l' => 'hpheacmtdb', 'b8liUIKLM7' => $email, /* * Spam protection field. * This must remain empty. */ 'email' => '', ], ] ); /* * WordPress could not connect to Laposta. */ if ( is_wp_error( $response ) ) { error_log( 'Laposta connection error: ' . $response->get_error_message() ); $ajax_handler->add_error( $email_field_id, 'Aanmelden lukt op dit moment niet. Probeer het later opnieuw.' ); return; } $status_code = wp_remote_retrieve_response_code( $response ); /* * Accept normal success responses and redirects. * Laposta may redirect after a successful subscription. */ if ( $status_code < 200 || $status_code >= 400 ) { error_log( 'Laposta returned HTTP status: ' . $status_code ); $ajax_handler->add_error( $email_field_id, 'Aanmelden lukt op dit moment niet. Probeer het later opnieuw.' ); return; } /* * No Elementor error is added here. * Elementor will therefore show its normal success message. */ }