Title: lancer85's Replies | WordPress.org

---

# lancer85

  [  ](https://wordpress.org/support/users/lancer85/)

 *   [Profile](https://wordpress.org/support/users/lancer85/)
 *   [Topics Started](https://wordpress.org/support/users/lancer85/topics/)
 *   [Replies Created](https://wordpress.org/support/users/lancer85/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/lancer85/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/lancer85/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/lancer85/engagements/)
 *   [Favorites](https://wordpress.org/support/users/lancer85/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Notification - Custom Notifications and Alerts for WordPress] Create Trigger Change Of User Meta Status And More](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/)
 *  Thread Starter [lancer85](https://wordpress.org/support/users/lancer85/)
 * (@lancer85)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/#post-14128841)
 * [@cpvb86](https://wordpress.org/support/users/cpvb86/) Yes I can, however the
   trigger on “personal_options_update” didn’t quite trigger as I expected. There
   were some finicky processes that didn’t pan out as I expected. I will upload 
   that code later today.
 * Thanks!
    -  This reply was modified 5 years, 7 months ago by [lancer85](https://wordpress.org/support/users/lancer85/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Notification - Custom Notifications and Alerts for WordPress] Create Trigger Change Of User Meta Status And More](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/)
 *  Thread Starter [lancer85](https://wordpress.org/support/users/lancer85/)
 * (@lancer85)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/#post-14117174)
 * No, It’s now turned on but nothing renders to the email.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Notification - Custom Notifications and Alerts for WordPress] Create Trigger Change Of User Meta Status And More](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/)
 *  Thread Starter [lancer85](https://wordpress.org/support/users/lancer85/)
 * (@lancer85)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/#post-14113732)
 * Hey Kuba,
 * I think I might have figured it out. For this one instance… still having issues
   with the merge tags, however, I was able to successfully trigger the user meta
   change by using the action hook “personal_options_update”. Which once the add_therapist
   AJAX call is complete the email is sent. I was able to go in and change the therapist
   and another email was sent. So, I am excited that worked! Just need to understand
   why I can’t get the merge tags not to render on the email side.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Notification - Custom Notifications and Alerts for WordPress] Create Trigger Change Of User Meta Status And More](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/)
 *  Thread Starter [lancer85](https://wordpress.org/support/users/lancer85/)
 * (@lancer85)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/#post-14113548)
 * Hey Kuba,
 * I was able to successfully get the trigger to happen on “update_user_meta” but
   the issue is that it fires each time the page reloads. I tried “profile_update”
   but according to WP docs this only fires when the user profile has been updated.
   Since this is user meta, the profile isn’t being updated, just the meta field.
 * So after further investigation, I need to use an action hook that detects the
   change for the meta that is being changed from ‘add_therapist’ function.
 * This is that function
 *     ```
       add_action( 'wp_ajax_nopriv_add_therapist', 'add_therapist' );
       add_action( 'wp_ajax_add_therapist', 'add_therapist' );
   
       function add_therapist(){
         $user_id = $_REQUEST['user'];
         $therapist_id = $_REQUEST['therapist'];
         update_user_meta($user_id, 'has_selected_therapist', 1);
         update_user_meta($user_id, 'selected_therapist_id', $therapist_id);
         update_user_meta($user_id, 'selected_therapist_status', 'Pending');
   
         echo 'Therapist has been selected';
         die();
   
       }
       ```
   
 * So essentially, I need to get the trigger to fire when update_user_meta(‘has_selected_therapist’)
   has been changed (to the 1). Is there anything I hook to that would work with
   the trigger??
 * Additionally, I am turned on background processing, and I am still not seeing
   the User First Name and Last Name rendering.
 * Here is that code:
 *     ```
       add_action( 'notification/elements', function() {
   
       	class TherapistSelected extends \BracketSpace\Notification\Abstracts\Trigger {
   
       		public function __construct() {
   
       				// Add slug and the title.
       				parent::__construct(
       						'therapistselected',
       						__( 'Therapist Selected Message', 'therapistselected' )
       				);
   
       				// Hook to the action.
       				$this->add_action( 'update_user_meta', 'add_therapist' );
   
       		}
   
       		public function merge_tags() {
   
       		$this->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\User\UserFirstName() );
       		$this->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\User\UserLastName() );
       		$this->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\User\UserEmail() );
   
       	}
   
   
       	}
   
       	notification_register_trigger( new TherapistSelected() );
       } );
       ```
   
 * Let me know if you see anything missing from this, or if there is a way to configure
   this better.
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Notification - Custom Notifications and Alerts for WordPress] Create Trigger Change Of User Meta Status And More](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/)
 *  Thread Starter [lancer85](https://wordpress.org/support/users/lancer85/)
 * (@lancer85)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/#post-14111353)
 * Ok, I will give that a try. If I continue to have an issue, I’ll let you know
   what issue I am facing and see if you can further assist. Thanks for your help
   thus far.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Notification - Custom Notifications and Alerts for WordPress] Create Trigger Change Of User Meta Status And More](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/)
 *  Thread Starter [lancer85](https://wordpress.org/support/users/lancer85/)
 * (@lancer85)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/create-trigger-change-of-user-meta-status-and-more/#post-14110436)
 * That is correct. The merge tags show up in the side bar, but the value isn’t 
   rendered on the email notification.
 * Could you provide an example of how to trigger an email on a meta field change?
 * My example is when a user chooses a therapist, I need to trigger an email to 
   that therapist. I have two meta fields that change, one that changes from false
   to true “has_selected_therapist” and the other is “selected_therapist_id”
 * I am trying to create this notification for a therapist to be alerted when a 
   user has selected them
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Image Aspect Ratio Crop Field for Advanced Custom Fields] ACF Not Doing Anything](https://wordpress.org/support/topic/acf-not-do-anything/)
 *  Thread Starter [lancer85](https://wordpress.org/support/users/lancer85/)
 * (@lancer85)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/acf-not-do-anything/#post-12803729)
 * Disregard, after further review, the version of ACF wasn’t compatible with the
   version of ACF Image Crop.
 * Thank you for your time.

Viewing 7 replies - 1 through 7 (of 7 total)