• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Store
    • Cart
    • Checkout
  • Blog
    • Basics [Free]
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Contact
  • Sign In
  • Show Search
Hide Search
Home » Actions » Use the Admin API to add a decline activation email

Use the Admin API to add a decline activation email

Chad Butler · Jun 6, 2016 ·

When using moderated registration, users are sent an email when they are activated.  This tutorial describes how to create an email when the user is deleted instead of activated.

This example uses the Admin API function wpmem_add_custom_email() to add a custom email that is sent to users when they are deleted.

This article is only available to WP-Members Support Subscribers. If you have an existing subscription, please login below. If you do not have a current support subscription, you can purchase a support subscription here.

Already a Member? Log In Here
   
Forgot password? Click here to reset

To gain full access to WP-Members premium content, a current support subscription is required. You can purchase an annual support subscription for as little as $59, which provides you with access to priority support, a customer support forum, access to code snippets, and more.

Why wait? Choose your subscription option here.

[
Why join?]

Actions, Tips and Tricks admin_api, api, wpmem_add_custom_email, wpmem_after_admin_init

Welcome to RocketGeek Interactive › Forums › Use the Admin API to add a decline activation email

Tagged: admin_api, api, wpmem_add_custom_email, wpmem_after_admin_init

  • This topic has 3 replies, 3 voices, and was last updated 3 years, 3 months ago by Chad Butler.
Viewing 2 reply threads
  • Author
    Posts
    • June 6, 2016 at 12:28 pm #10295
      Chad Butler
      Keymaster

      When you set up moderated registration, users are sent an email when they are activated.  But I have had people ask about adding an email to go out if
      [See the full post at: Use the Admin API to add a decline activation email]

    • December 28, 2016 at 2:18 pm #11982
      saharnava
      Blocked

      Here is a another way to send the email with the from registered in the admin panel and in HTML format :

      add_action( 'delete_user', 'my_delete_user' );
      function my_delete_user( $user_id ) {
           
          $email = get_option( 'my_decline_activation' );
          $user_obj = get_userdata( $user_id );
          $send_to = $user_obj->user_email;
          $headers = array(
          	'Content-Type: text/html; charset=UTF-8',
          );
          add_filter( 'wp_mail_from', 'wpmem_mail_from' );
          add_filter( 'wp_mail_from_name', 'wpmem_mail_from_name' );
          wp_mail( $send_to, $email['subj'], $email['body'], $headers );
      }
    • October 1, 2017 at 5:23 pm #13672
      bonbon
      Participant

      Hi there, can someone please help me with this, I am so confused and I really need to have this feature x

      Kindly Stephanie

      • October 1, 2017 at 7:55 pm #13673
        Chad Butler
        Keymaster

        The two code snippets in the article are basically cut-and-paste ready. You can add these to your theme’s functions.php (see “Using Code Snippets from the Site” for more info).

        Once applied, you’ll have a custom email in the plugin’s Emails tab for the email content and the other filter will send it when the user is deleted (it’s hooked to the action fired when a user is deleted).

        If you’re lost, let me know where and I’ll do my best to help you along.

  • Author
    Posts
Viewing 2 reply threads
  • You must be logged in to reply to this topic.
Log In

Ready to get started?

Join Today!

© 2021 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Refund Policy