Sometimes when you are moving files from one host to another, you have to change the files owner or permissions so the web server can utilize it properly.
There are rare instances that you need to be able to programmatically make sure the from email is not set to a certain email. Using the following filter will allow you to modify the From portion of the header before it sends. This code Snippet uses the fix_email snippet that can be found by clicking here.
add_filter( 'gform_pre_send_email', 'before_email_sent', 10, 4 );
function before_email_sent( $email, $message_format, $notification, $entry ) {
// If GF logging is enabled, then it will record the a before an after of the email in the log.
GFCommon::log_debug( __METHOD__ . '(): EMAIL BEFORE => ' . print_r( $email, true ) );
$newEmail = 'correct@email.com';
if ($newEmail != '') {
// Check the Fix Email Function code snippet for what this does. It pretty much just changes the email within <> of the string.
$updated_from = fix_email($email['headers']['From'], $newEmail);
$email['headers']['From'] = $updated_from;
}
GFCommon::log_debug( __METHOD__ . '(): EMAIL AFTER => ' . print_r( $email, true ) );
return $email;
}
Sometimes when you are moving files from one host to another, you have to change the files owner or permissions so the web server can utilize it properly.
Here is a Linux command line that searches for files that are over a certain size so that you can find where you might be able to free up some space. Useful to find error_logs that have run amok.
Here is a method to import a SQL file into a database via the Linux command line.
Copyright © 2025 FalkensMaze.dev - Sitemap