Noptin_Email_Action::can_run( Noptin_Subscriber $subscriber, Noptin_Automation_Rule $rule, array $args )
Returns whether or not the action can run (dependancies are installed).
Parameters Parameters
- $subscriber
(Noptin_Subscriber) (Required) The subscriber.
- $rule
(Noptin_Automation_Rule) (Required) The automation rule used to trigger the action.
- $args
(array) (Required) Extra arguments passed to the action.
Return Return
(bool)
Source Source
File: includes/automation-rules/actions/class-noptin-email-action.php
public function can_run( $subscriber, $rule, $args ) { // Abort if we do not have a subject or an email. if ( empty( $rule->action_settings['email_content'] ) || empty( $rule->action_settings['email_subject'] ) ) { log_noptin_message( sprintf( __( 'Email automation rule action not sent to %s because either the subject or the content has not been set' ), $subscriber->email ) ); return false; } // We only want to send an email to active subscribers. if ( ! empty( $subscriber->active ) ) { log_noptin_message( sprintf( __( 'Email automation rule action not sent to %s because the subscriber is not active' ), $subscriber->email ) ); return false; } return true; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.3.3 | Introduced. |