Viewing 1 replies (of 1 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    We don’t have anything for that set up out of the box, but there is a hook that you could use to do your own wiring up.

    do_action( 'badgeos_award_achievement', $user_id, $achievement_id, $this_trigger, $site_id, $args );

    It’ll fire whenever an achievement is awarded, and you’ll be provided with the User’s ID, the awarded achievement ID, the trigger that caused it, the site ID (helpful if a multisite more than anything), and some other args I can’t recall at the moment.

    Since achievement types are post types and achievements are posts in the associated post type, all post type based functionality applies, including post meta functions. You could use the achievement_id to fetch the name of the achievement type to use in the email, for example, and get the associated email address from the user’s data. After that, just send an email off with wp_mail() or whatever custom mail functionality your site may have.

Viewing 1 replies (of 1 total)
  • The topic ‘Email user upon achieving badge’ is closed to new replies.