Title: after registration
Last modified: August 20, 2016

---

# after registration

 *  [ugetpaid2](https://wordpress.org/support/users/ugetpaid2/)
 * (@ugetpaid2)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/after-registration/)
 * I want to set my site up so that when a visitor registers on my site they are
   automatically sent a package of 6 downloadable e-books on internet marketing.
   How would I go about accomplishing that? any ideas? Thanks for taking the time
   to read this and double thanks if you reply.

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/after-registration/#post-2908562)
 * New users are sent a confirmation email via the wp_new_user_notification() function
   in wp-includes/pluggable.php around line 1188 for 3.4.1. As a pluggable function,
   just copy the whole function definition to your plugin, theme, or child theme,
   and it will override the default function.
 * On your copy, edit the last call to wp_mail() to include the $attachements parameter,
   which is either an array of filenames or a newline delimited list of filenames
   to attach to the email. You’ll probably want to jazz up the other default email
   elements as well. It is all done by what’s passed to wp_mail().
 *  Thread Starter [ugetpaid2](https://wordpress.org/support/users/ugetpaid2/)
 * (@ugetpaid2)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/after-registration/#post-2908576)
 * LOL I’m already lost. How much will it cost me to get you to do this since you
   know all so well what you are talking about?
 *  [alsmith](https://wordpress.org/support/users/alsmith/)
 * (@alsmith)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/after-registration/#post-2908583)
 * I would put all your attachments in a single zip file upload it to somewhere 
   like wp-cntent/uploads.
    then put this inside your functions.php file (make sure
   lines wrap and are not seperated.)
 *     ```
       function wp_new_user_notification($user_id, $plaintext_pass = '') {
               $attachments = array(WP_CONTENT_DIR . '/uploads/yourzipfile.zip');
               $user = new WP_User($user_id);
               $user_login = stripslashes($user->user_login);
               $user_email = stripslashes($user->user_email);
   
               // The blogname option is escaped with esc_html on the way into the databa
       se in sanitize_option
               // we want to reverse this for the plain text arena of emails.
               $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
   
               $message  = sprintf(__('New user registration on your site %s:'), $blognam
       e) . "\r\n\r\n";
               $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
               $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
   
               @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration
       '), $blogname), $message, $attachments);
   
               if ( empty($plaintext_pass) )
                       return;
   
               $message  = sprintf(__('Username: %s'), $user_login) . "\r\n";
               $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
               $message .= wp_login_url() . "\r\n";
   
               wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogn
       ame), $message);
   
       }
       ```
   
 * I added $attachments to the wp_mail function call and identified the $attachments
   first line inside the function
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/after-registration/#post-2908585)
 * Please try [http://jobs.wordpress.net/](http://jobs.wordpress.net/)
    Topic now
   closed as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Offering_to_Pay)

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

The topic ‘after registration’ is closed to new replies.

## Tags

 * [ebooks](https://wordpress.org/support/topic-tag/ebooks/)
 * [email](https://wordpress.org/support/topic-tag/email/)
 * [registeration?](https://wordpress.org/support/topic-tag/registeration/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 4 replies
 * 4 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/after-registration/#post-2908585)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
