Advertisement
geminilabs

[site-reviews] Add "reply-to" header to email notifications

Jul 9th, 2021 (edited)
146
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * @param array $details
  3.  * @param \GeminiLabs\SiteReviews\Modules\Email $email
  4.  * @return array
  5.  */
  6. add_filter('site-reviews/email/compose', function ($details, $email) {
  7.     // Get the email address submitted with the review
  8.     $emailAddress = glsr_get($email, 'data.review.email');
  9.     // If an email was submitted with the review, use it as the reply-to header
  10.     if (!empty($emailAddress)) {
  11.         $details['reply-to'] = $emailAddress;
  12.     }
  13.     return $details;
  14. }, 10, 2);
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement