Advertisement
geminilabs

Untitled

Aug 24th, 2023 (edited)
1,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. /**
  2.  * This snippet make a {membership_info} tag available in email notifications
  3.  *
  4.  * @param array $args
  5.  * @param \GeminiLabs\SiteReviews\Modules\Email|\GeminiLabs\SiteReviews\Addon\Notifications\Email $email
  6.  * @return array
  7.  */
  8. add_filter('site-reviews/email/compose', function ($args, $email) {
  9.     $review = glsr()->args($email->data)->review;
  10.     if (empty($review)) {
  11.         return $args;
  12.     }
  13.     if ($user = $review->user()) {
  14.         $membership = ''; // TODO: put the user's membership info here as a string
  15.         $args['template-tags']['membership_info'] = $membership;
  16.     }
  17.     return $args;
  18. }, 10, 2);
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement