| 1 |
<?php |
| 2 |
/** |
| 3 |
* In-plugin summary emails controller |
| 4 |
* |
| 5 |
* @since 6.7 |
| 6 |
* @package Formidable |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
die( 'You are not allowed to call this page directly.' ); |
| 11 |
} |
| 12 |
|
| 13 |
/** |
| 14 |
* Class FrmEmailSummaryController |
| 15 |
*/ |
| 16 |
class FrmEmailSummaryController { |
| 17 |
|
| 18 |
/** |
| 19 |
* Maybe send summary emails. |
| 20 |
*/ |
| 21 |
public static function maybe_send_emails() { |
| 22 |
$emails = FrmEmailSummaryHelper::should_send_emails(); |
| 23 |
if ( ! $emails ) { |
| 24 |
return; |
| 25 |
} |
| 26 |
|
| 27 |
foreach ( $emails as $email ) { |
| 28 |
if ( method_exists( 'FrmEmailSummaryHelper', 'send_' . $email ) ) { |
| 29 |
call_user_func( array( 'FrmEmailSummaryHelper', 'send_' . $email ) ); |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
} |
| 34 |
|