WordPress.org

Forums

WordPress Guest Post Plugin
Steals wp_mail body/content (2 posts)

  1. Tribulant Software
    Member
    Posted 2 years ago #

    Unfortunately it breaks wp_mail() taking any email being sent through wp_mail() and replacing it's body/content with the guest post form.

  2. williamgenske
    Member
    Posted 2 years ago #

    I have an issue with a plugin that uses the wp_mail function, which I am trying to solve. Basically the following piece of code will generate an email once a certain condition has been met within the website:

    function simplr_activate_users( $ids = false ) {
    if( !$ids ) {
    if( @$_REQUEST['action'] == 'sreg-activate-selected' AND !empty($_REQUEST['users']) ) {
    simplr_activate_users( $_REQUEST['users'] );
    }
    }
    else {
    global $wpdb,$simplr_options;
    foreach( $ids as $id ) {
    $return = $wpdb->update( $wpdb->users, array( 'user_status'=> 0 ), array( 'ID' => $id ), array('%d'), array('%d') );
    if( !$return ) {
    return new WP_Error( "error", "Benutzer konnte nicht aktiviert werden." );
    }
    $data = (array) get_userdata( $id );
    $data = (array) $data['data'];
    $data['blogname'] = get_option('blogname');
    do_action('simplr_activated_user', $data);
    $subj = simplr_token_replace( $simplr_options->mod_email_activated_subj, $data );
    $content = simplr_token_replace( $simplr_options->mod_email_activated, $data );
    $headers = "From: ".$data['blogname']."<".get_option('admin_email').">\r\n";
    wp_mail( $data['user_email'], $subj, $content);

    The last line of the code "wp_mail( $data['user_email'], $subj, $content);" generates an email with a preset message to the user. I am trying to add a parameter to the email body (or subject), which identifies the email/first_name/last_name of the user who has just registered.

    Any help is greatly appreciated.

    Thank you in advance.

    William Genske

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Guest Post Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.