jhofmann
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact form 7 TO API] build in a function to get tokenSo I think, I’m a few steps further:
I added the function as a plugin. It should be triggered by this in submission.php:
private function before_send_mail() {
$abort = false;do_action_ref_array( ‘wpcf7_before_send_mail’, array(
$this->contact_form,
&$abort,
$this,
) );return ! $abort;
}my index.php in my plugin-directory looks like:
<?php
/*Plugin Name: Get Filemaker token
Plugin URI:
Description:
Author: myself
Version: 1.0
Author URI:
*/
add_action(“wpcf7_before_send_mail”, “wpcf7_get_fmToken”, 10, 3);
function wpcf7_get_fmToken ($WPCF7_ContactForm) {
//just for testing write into file
$jhFile = ‘test.txt’;if ( file_exists( $jhFile ) ) {
$file = fopen( $jhFile, ‘a’ );
} else {
$file = fopen( $jhFile, ‘w’ );
}
fwrite( $file, “Function has been triggered\n” );fclose($file);
}
?>
But it doesn’t work even with full rights on files and plugin directory.
These rights are sufficient, aren’t they?
Plugin directory: 755
Plugin index.php: 755
test.txt: 775Has anyone any ideas? For this I would be very grateful.
Best regards