Skip to content

Commit

Permalink
Merge pull request #100 from wp-blocks/fix/email-custom
Browse files Browse the repository at this point in the history
Resend to custom email address
  • Loading branch information
erikyo authored Jan 26, 2024
2 parents e643d77 + 979d37b commit f3ec0dd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions core/CF7_AntiSpam_Flamingo.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,14 @@ public function cf7a_resend_mail( $mail_id ) {
$form_props = $form->get_properties();
$recipient = $form_props['mail']['recipient'];
if ( $form_props['mail']['recipient'] || ! empty( $flamingo_data->meta['recipient'] ) ) {
if ( $recipient === '[_site_admin_email]' ) {
$recipient = $flamingo_data->meta['site_admin_email'];
} elseif ( $recipient === '[_post_author]' ) {
$recipient = get_option( 'post_author_email' );
} else {
$recipient = get_option( 'admin_email' );
if ( ! filter_var( $recipient, FILTER_VALIDATE_EMAIL ) || ! empty( $recipient ) ) {
if ( $recipient === '[_site_admin_email]' ) {
$recipient = $flamingo_data->meta['site_admin_email'];
} elseif ( $recipient === '[_post_author]' ) {
$recipient = get_option( 'post_author_email' ); // check this, not sure 🤔
} else {
$recipient = get_option( 'admin_email' );
}
}
}

Expand Down

0 comments on commit f3ec0dd

Please sign in to comment.