| Server IP : 192.241.186.36 / Your IP : 216.73.216.164 Web Server : Apache/2.4.29 (Ubuntu) System : Linux webserver7 4.15.0-194-generic #205-Ubuntu SMP Fri Sep 16 19:49:27 UTC 2022 x86_64 User : root ( 0) PHP Version : 7.4.32 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/pushyard/wp-content/plugins/formidable/classes/models/ |
Upload File : |
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( 'You are not allowed to call this page directly.' );
}
class FrmNotification {
public function __construct() {
self::hook_emails_to_action();
}
/**
* Trigger an email action
*
* @param object $action
* @param object $entry
* @param object $form
*
* @return void
*/
public static function trigger_email( $action, $entry, $form ) {
$email = new FrmEmail( $action, $entry, $form );
if ( ! $email->should_send() ) {
return;
}
$sent = $email->send();
if ( $sent ) {
self::print_recipients( $email->package_atts() );
}
}
/**
* Remove the trigger_email function from the frm_trigger_email_action hook
*
* @since 2.03.04
*
* @return void
*/
public static function stop_emails() {
remove_action( 'frm_trigger_email_action', 'FrmNotification::trigger_email', 10 );
}
/**
* Hook the trigger_email function to frm_trigger_email_action action
*
* @since 2.03.04
*
* @return void
*/
public static function hook_emails_to_action() {
add_action( 'frm_trigger_email_action', 'FrmNotification::trigger_email', 10, 3 );
}
/**
* Print the recipients
*
* @since 2.03.04
*
* @param array $atts
*
* @return void
*/
private static function print_recipients( $atts ) {
if ( apply_filters( 'frm_echo_emails', false ) ) {
$sent_to = array_merge( (array) $atts['to_email'], (array) $atts['cc'], (array) $atts['bcc'] );
$sent_to = array_filter( $sent_to );
$temp = str_replace( '<', '<', $sent_to );
echo ' ' . FrmAppHelper::kses( implode( ', ', (array) $temp ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
}