Title: Get E-Mailnotifications
Last modified: October 16, 2018

---

# Get E-Mailnotifications

 *  Resolved [gerrooo](https://wordpress.org/support/users/gerrooo/)
 * (@gerrooo)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/get-e-mailnotifications/)
 * Hey Kevin,
 * Is there any possibility to receive an e-mail when s new user has subscribed 
   herself using the opt-in form? I would like to get a notification for every new
   subscriber (tried to do that in mailchimp, which does not work properly).
 * Thank you in advance for the information.
 * Kind regards,
 * Gerardo

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

 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/get-e-mailnotifications/#post-10785788)
 * Hi Gerardo,
 * We don’t support sending email from our plugin because email is complicated and
   each site might handle their mail differently.
 * However, we do have a few snippets that I’ve given out and that I know a few 
   of our users use.
 * **Make sure to replace YOUR-EMAIL-HERE with your email address.**
 * This snippet will send an email whenever the form is submitted (i.e. successful
   and unsuccessful submissions).
 *     ```
       add_action( 'yikes-mailchimp-form-submission', 'yikes_send_email_after_submission', 10, 4 );
   
       function yikes_send_email_after_submission( $email, $merge_variables, $form_id, $notifications ) {
   
        	$interface   = yikes_easy_mailchimp_extender_get_form_interface();
       	$form_data   = $interface->get_form( $form_id );
       	$form_name   = $form_data['form_name'];
       	$content     = '<p>MailChimp Submission for Form: ' . $form_name . '</p>';
        	$content    .= '<p>A user with the email ' . $email . ' has attempted to subscribe to your MailChimp list.</p>';
        	$content    .= '<p>Here is their information: </p><br>';
        	foreach ( $merge_variables as $merge_tag => $merge_value ) {
        		$content .= '<p>' . $merge_tag . ': ' . ( is_array( $merge_value ) ? implode( ', ', $merge_value ) : $merge_value ) . '</p>';
        	}
        	$admin_email = 'YOUR-EMAIL-HERE';
        	$subject     = 'New MailChimp Submission for Form: ' . $form_name;
        	$headers     = array( 'Content-Type: text/html; charset=UTF-8' );
   
        	wp_mail( $admin_email, $subject, $content, $headers );
       }
       ```
   
 * This snippet will send an email for successful submissions (it also doesn’t include
   as much data as the previous snippet).
 *     ```
       add_action( 'yikes-mailchimp-after-submission', 'yikes_send_email_after_successful_submission', 10, 1 );
   
       function yikes_send_email_after_successful_submission( $merge_variables ) {
        	$content    .= '<p>A user has subscribed to your MailChimp list.</p>';
        	$content    .= '<p>Here is their information: </p><br>';
        	foreach ( $merge_variables as $merge_tag => $merge_value ) {
        		$content .= '<p>' . $merge_tag . ': ' . ( is_array( $merge_value ) ? implode( ', ', $merge_value ) : $merge_value ) . '</p>';
        	}
        	$admin_email = 'YOUR-EMAIL-HERE';
        	$subject     = 'New MailChimp Submission';
        	$headers     = array( 'Content-Type: text/html; charset=UTF-8' );
   
        	wp_mail( $admin_email, $subject, $content, $headers );	
       }
       ```
   
 * Cheers,
    Kevin.
 *  Thread Starter [gerrooo](https://wordpress.org/support/users/gerrooo/)
 * (@gerrooo)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/get-e-mailnotifications/#post-10795669)
 * Hey Kevin,
 * Thanks a lot! Everything works now.
 * Regards,
 * Gerardo
 *  [Marc](https://wordpress.org/support/users/emedia/)
 * (@emedia)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/get-e-mailnotifications/#post-11093685)
 * Hi Kevin,
 * Can you tell me where this snippet gets added? Thanks in advance.
 * Marc
    -  This reply was modified 7 years, 4 months ago by [Marc](https://wordpress.org/support/users/emedia/).
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/get-e-mailnotifications/#post-11095578)
 * Hi Marc,
 * This snippet should be added to your child theme’s `functions.php` file. If you’re
   not using a child theme, then you can add it to your theme’s `functions.php` 
   file or use a plugin like [My Custom Functions](https://wordpress.org/plugins/my-custom-functions/).
 * Cheers,
    Kevin.

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

The topic ‘Get E-Mailnotifications’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/yikes-inc-easy-mailchimp-extender_a1c7e5.
   svg)
 * [Easy Forms for Mailchimp](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/)
 * [Active Topics](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/get-e-mailnotifications/#post-11095578)
 * Status: resolved