PHP code example of stereo / contact-form

1. Go to this page and download the library: Download stereo/contact-form library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stereo / contact-form example snippets


add_filter('st_cf_mail_to',function() {
    return 'Your Mom <[email protected]>';
});

add_filter('st_cf_mail_from',function() {
    return 'Your Mom <[email protected]>';
});

add_filter('st_cf_mail_subject',function($subject) {
    return '[My rebranded CMS] '.$subject;
});

add_filter('st_cf_mail_content',function($content) {
    return '<html><body style="background:pink;">'.$content.'</body></html>';
});

add_filter('st_cf_mail_field',function($field) {
    return 'Email';
});

add_filter('st_cf_mail_headers',function($headers) {
    $headers[] = "X-Some: More-Headers";
    return $headers;
});

add_filter('st_cf_mailmsg',function($msg) {
    return 'New form entry : ';
    // Default : Nouveau formulaire reçu, voici l'information
});

add_filter('st_cf_mail_field',function($field) {
    return 'Email';
});

add_filter('st_cf_mail_headers',function($headers) {
    $headers[] = "X-Some: More-Headers";
    return $headers;
});

add_action('st_cf_files',function($files,$postid) {
    foreach($files as $f)  {
        // $f is a temp file path that will be deleted after this hook.
    }
}, 10, 2);

add_filter('st_cf_files_external',function($files, $post_id) {
    $files[] = $file_name;
    return $files;
}, 10, 2);