Send email when flamingo message in marked as “Not Spam”
-
Hello ! Could it be possible for you to create a hook (action or filter) for the function “unspam” of the plugin , so we could surcharge it on our theme functions.php to send email to the admin email website for exemple with the information of the message that has been changed as “Not spam”.
It could really be useful when there is a recaptcha problem or something like this that put real message in SPAM.
I find something like this here : https://www.ads-software.com/support/topic/does-flamingo-resend-messages-when-marked-as-not-spam/
public function unspam() {
if ( ! $this->spam ) {
return;
}$this->akismet_submit_ham();
$this->spam = false;// start addition
$message = “This message was marked as ‘Not Spam’.<br />”;
$message .= “<br />From: “.$this->from_name;
$message .= “<br />Email: “.$this->from_email;
$message .= “<br />Subject: “.$this->subject;
$message .= “<br />Message Body: “.$this->fields[‘your-message’];$skipfields = array(‘site_url’,’url’,’post_id’,’post_name’,’post_url’,’post_title’,’post_author’,’post_author_email’,’site_title’,’site_description’);
foreach($this->meta as $k=>$v){
if(!in_array($k,$skipfields)){$message .=”“.$k.”: “.$v.”<br />”;}
}$to = $this->meta[‘site_admin_email’];
$subject = ‘SUBJECT HERE -‘.$this->subject.'”‘;
$headers = array(‘Reply-To: ‘.$this->from_name.’ <‘.$this->from_email.’>’);
wp_mail($to,$subject,$message,$headers);// end addition
return $this->save();
}
- The topic ‘Send email when flamingo message in marked as “Not Spam”’ is closed to new replies.