Title: melchi2's Replies | WordPress.org

---

# melchi2

  [  ](https://wordpress.org/support/users/melchi2/)

 *   [Profile](https://wordpress.org/support/users/melchi2/)
 *   [Topics Started](https://wordpress.org/support/users/melchi2/topics/)
 *   [Replies Created](https://wordpress.org/support/users/melchi2/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/melchi2/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/melchi2/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/melchi2/engagements/)
 *   [Favorites](https://wordpress.org/support/users/melchi2/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 93 total)

1 [2](https://wordpress.org/support/users/melchi2/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/melchi2/replies/page/3/?output_format=md)…
[5](https://wordpress.org/support/users/melchi2/replies/page/5/?output_format=md)
[6](https://wordpress.org/support/users/melchi2/replies/page/6/?output_format=md)
[7](https://wordpress.org/support/users/melchi2/replies/page/7/?output_format=md)
[→](https://wordpress.org/support/users/melchi2/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] celebration birthday](https://wordpress.org/support/topic/celebration-birthday/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/celebration-birthday/#post-16398220)
 *     ```wp-block-code
       function um_080822_email_notifications( $notifications ){
   
       	$notifications['um_greet_todays_birthdays'] = array(
       		'key'           	=> 'um_greet_todays_birthdays',
       		'title'         	=> __( 'Joyeux anniversaire!','um-groups' ),
       		'subject'       	=> 'Joyeux anniversaire de {site_name}',
       		'body'          	=> 'Bonjour {display_name},<br /><br />'.
       		                   'Nous te souhaitons un joyeux anniversaire!',
       		'description'   	=> __('Whether to send the user an email when someone\'s todays birthday.','um-member'),
       		'recipient'   	 	=> 'member',
       		'default_active' 	=> true
       	);
   
       	return $notifications;
       }
       add_filter( 'um_email_notifications', 'um_080822_email_notifications', 10, 1 );
   
       function um_080822_cron_task_birthday_greet_notification(){
   
           $date = date("/m/d");
   
           $query_args['meta_query'][ ] = array(
               'relation' => 'AND',
               array(
                   'key' => 'birth_date_45_31',
                   'value' => $date,
                   'compare' => 'RLIKE'
               ),
               array(
                   'key' => 'um_birthday_greeted_' . md5( $date ),
                   'compare' => 'NOT EXISTS'
               )
           );
   
           $users = new WP_User_Query( $query_args );
   
           // Get the results
           $celebrants = $wp_user_query->get_results();
   
           // Check for results
           if ( !empty( $celebrants ) ) {
   
               foreach( $celebrants as $c ){
                   $recipient_email = $c->user_email;
   
                   $display_name = um_user("display_name");
   
                   UM()->mail()->send( $recipient_email, 'um_greet_todays_birthdays', array(
                               'plain_text'	 => 1,
                               'tags'				 => array(
                                   '{display_name}',
                               ),
                               'tags_replace' => array(
                                   $display_name,
                               )
                   ) );
   
   
                   update_user_meta( $c->ID, 'um_birthday_greeted_' . md5( $date ), true );
               }
   
           }
       }
       add_action("um_do2_birthday_greet_notification","um_080822_cron_task_birthday_greet_notification");
   
       if ( ! wp_next_scheduled ( 'um_do2_birthday_greet_notification') ) {
           wp_schedule_event( time(), 'hourly', 'um_do2_birthday_greet_notification' );
       }
       ```
   
 * I tried with the script but unfortunately it doesn’t work. In the database the
   date of birth is in this form birth_date_45_31 1984/11/22. I don’t understand
   what is blocking
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] validation register user](https://wordpress.org/support/topic/validation-register-user/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/validation-register-user/#post-16396760)
 * Hello, I am sending you the script that allows the sponsor to receive an email
   when registering the godchild, to visit his file and to check the sponsor’s email
   during registration.<font _mstmutation=”1″ _msthash=”1047670″></font>
 *     ```wp-block-code
       add_action( 'um_custom_field_validation_email_parrain', 'um_custom_validate_email_parrain', 999, 3 );
       function um_custom_validate_email_parrain( $key, $array, $args ) {
           if ( $key == 'email_parrain' && isset( $args['email_parrain'] ) ) {
               if ( isset( UM()->form()->errors['email_parrain'] ) ) {
                   unset( UM()->form()->errors['email_parrain'] );
               }
               if ( ! is_email( $args['email_parrain'] ) ) {
                   UM()->form()->add_error( 'email_parrain', __( 'L’adresse e-mail du parrain que vous avez saisie n’est pas valide', 'membre-ultime' ) );
               } elseif ( ! email_exists( $args['email_parrain'] ) ) {
                   UM()->form()->add_error( 'email_parrain', __( 'L’adresse e-mail du parrain que vous avez saisie n\'existe pas dans les comptes des membres.', 'membre-ultime' ) );
               }
           }
       }
   
   
       /**
        * Set custom email notification template and setting
        */
       function um_custom_validate_account( $notifications ){
   
           $notifications['um_custom_validate_account'] = array(
               'key'           	=> 'um_custom_validate_account',
               'title'         	=> __( 'Send Email for Sponsors Validation','ultimate-member' ),
               'subject'       	=> '{site_name} - Someone you have sponsored on the site needs to attention',
               'body'          	=> 'Hi,<br /><br />'.
                                  'You have sponsored "{profile_name}" on the site.<br /><br />'.
                                  'To view profile, please click the following link: {profile_link}',
               'description'   	=> __('Whether to send the sponsor an email when someone registered has sponsored with.','ultimate-member'),
               'recipient'   	 	=> 'admin',
               'default_active' 	=> true
           );
   
           return $notifications;
       }
       add_filter( 'um_email_notifications', 'um_custom_validate_account', 10, 1 );
   
       /**
        * Send email notification to the sponsor
        */
       function um_notify_sponsors( $user_id ){
           um_fetch_user( $user_id ); 
           $sponsor_email = um_user("email_parrain");
           if (!filter_var($sponsor_email, FILTER_VALIDATE_EMAIL)) {
               // Afficher un message d'erreur
               UM()->notifications()->add( 'SponsorInvalidEmail', 'L\'adresse e-mail du parrain n\'est pas valide.' );
               return;
           }
   
           if ( ! email_exists( $sponsor_email ) ) {
               // Afficher un message d'erreur
               UM()->notifications()->add( 'SponsorNotExist', 'L\'adresse e-mail du parrain n\'existe pas dans les comptes des membres.' );
               return;
           }
           // code pour envoyer la notification
           $sponsor_recipient = $sponsor_email;
           $profile_name = um_user("display_name");
           $profile_link = '<a href="' . um_user_profile_url( $user_id ) . '">' . um_user_profile_url( $user_id ) . '</a>';
   
           UM()->mail()->send( $sponsor_recipient, 'um_custom_validate_account', array(
                       'plain_text'	 => 1,
                       'tags'				 => array(
                           '{profile_name}',
                           '{profile_link}',
                       ),
                       'tags_replace' => array(
                           $profile_name,
                           $profile_link,
                       )
           ) );
   
       }
       add_action("um_after_save_registration_details","um_notify_sponsors",10, 2);
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] member directory solved register filter](https://wordpress.org/support/topic/member-directory-solved-register-filter/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/member-directory-solved-register-filter/#post-16342445)
 * Thank you, I had found in the meantime and I had forgotten to close this topic,
   I apologize? I was sure I did, I’ll do an overview of all my messages for the
   closed if I found a solution
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Frontend Post WordPress Plugin - AccessPress Anonymous Post] Ultimate member](https://wordpress.org/support/topic/ultimate-member-39/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/ultimate-member-39/#post-16326967)
 *     ```wp-block-code
       I found a better solution a notification when a new article is created and visible to all
   
       add_filter( 'um_notifications_core_log_types', 'add_new_article_notification_type', 200 );
       function add_new_article_notification_type( $array ) {
           $array['new_article'] = array(
               'title' => 'Nouvel article publié',
               'template' => 'Un nouvel article intitulé "{article_title}" a été publié par {member}.',
               'account_desc' => 'Quand un nouvel article est publié sur le site',
           );
   
           return $array;
       }
   
       add_filter( 'um_notifications_get_icon', 'add_new_article_notification_icon', 10, 2 );
       function add_new_article_notification_icon( $output, $type ) {
           if ( $type == 'new_article' ) {
               $output = '<i class="um-icon-article" style="color: #336699"></i>';
           }
   
           return $output;
       }
   
       add_action( 'publish_post', 'send_new_article_notification', 10, 2 );
       function send_new_article_notification( $ID, $post ) {
           $author_id = $post->post_author;
           $title = $post->post_title;
           $permalink = get_permalink( $ID );
   
           um_fetch_user( $author_id );
           $author_name = um_user( 'display_name' );
   
           $vars = array(
               'article_title' => $title,
               'member' => $author_name,
               'notification_uri' => $permalink,
           );
   
           // Envoyer une notification à tous les utilisateurs du site
           $users = get_users();
           foreach ( $users as $user ) {
               UM()->Notifications_API()->api()->store_notification( $user->ID, 'new_article', $vars );
           }
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] validation register user](https://wordpress.org/support/topic/validation-register-user/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/validation-register-user/#post-16326962)
 * <font _mstmutation=”1″ _msthash=”881764″></font>
 * Here is the final script that works
 * /**
 *   * Set custom email notification template and setting
 *   */
 *  function um_custom_validate_account( $notifications ){
 * $notifications[‘um_custom_validate_account’] = array(
 * ‘key’           => ‘um_custom_validate_account’,
 * ‘title’         => __( ‘Send Email for Sponsors Validation’,’ultimate-member’),
 * ‘subject’       => ‘{site_name} – Someone you have sponsored on the site needs
   to attention’,
 * ‘body’          => ‘Hi,<br /><br />’.
 *                   ‘You have sponsored “{profile_name}” on the site.<br /><br /
   >’.
 *                   ‘To view profile, please click the following link: {profile_link}’,
 * ‘description’   => __(‘Whether to send the sponsor an email when someone registered
   has sponsored with.’,’ultimate-member’),
 * ‘recipient’   => ‘admin’,
 * ‘default_active’ => true
 * );
 * return $notifications;
 * }
 * add_filter( ‘um_email_notifications’, ‘um_custom_validate_account’, 10, 1 );
 * /**
 *  * Send email notification to the sponsor
 *  */
 * function um_notify_sponsors( $user_id ){
 *     um_fetch_user( $user_id ); 
 *     $sponsor_recipient = um_user(“email_parrain”);
 * $profile_name = um_user(“display_name”);
 * $profile_link = ‘<a href=”‘ . um_user_profile_url( $user_id ) . ‘”>’ . um_user_profile_url(
   $user_id ) . ‘</a>’;
 * UM()->mail()->send( $sponsor_recipient, ‘um_custom_validate_account’, array(
 * ‘plain_text’ => 1,
 * ‘tags’ => array(
 * ‘{profile_name}’,
 * ‘{profile_link}’,
 * ),
 * ‘tags_replace’ => array(
 * $profile_name,
 * $profile_link,
 * )
 * ) );
 * }
 * add_action(“um_after_save_registration_details”,”um_notify_sponsors”,10, 2);
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] member directory solved register filter](https://wordpress.org/support/topic/member-directory-solved-register-filter/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/member-directory-solved-register-filter/#post-16314698)
 * Hello Veronica,
 * Sorry I thought I sent my message in English, sorry
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] account menu add logout](https://wordpress.org/support/topic/account-menu-add-logout/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/account-menu-add-logout/#post-16308803)
 * Hello, I’m reassured, I thought it was me who had searched badly. I’ll see how
   to set it up. Thank you for everything, I put the ticket in solved<font _mstmutation
   =”1″ _msthash=”1015495″>
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] validation register user](https://wordpress.org/support/topic/validation-register-user/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/validation-register-user/#post-16302715)
 * <font _mstmutation=”1″ _msthash=”991094″>
 * /**
    - Set custom email notification template and setting
      */function um_custom_validate_account(
      $notifications ){ $notifications[‘um_custom_validate_account’] = array(‘key’
      => ‘um_custom_validate_account’,‘title’ => **( ‘Send Email for Sponsors Validation’,’
      ultimate-member’ ), ‘subject’ => ‘{site_name} – Someone you have sponsored
      on the site needs to attention’, ‘body’ => ‘Hi,‘. ‘ You have sponsored “{profile_name}”
      on the site.‘. ‘To view profile, please click the following link: {user_profile_url}’,‘
      description’ => (‘Whether to send the sponsor an email when someone registered
      has sponsored with.’,’ultimate-member’),‘recipient’ => ‘admin’,‘default_active’
      => true); return $notifications;}add_filter( ‘um_email_notifications’, ‘um_custom_validate_account’,
      10, 1 );
 * /**
    - I post it here, you never know it can be useful, with this code the profile
      and the sending of notification is done, the only problem is the link to the
      profile which does not work<font _mstmutation=”1″ _msthash=”1325532″>
    - Envoyer une notification par e-mail au sponsor
      */function um_notify_sponsors(
      $user_id ){ um_fetch_user( $user_id ); $sponsor_recipient = um_user(« email_parrain»);
      $profile_name = um_user(« display_name »); $profile_url = um_user_profile_url(
      $user_id ); UM()->mail()->send( $sponsor_destinataire, ‘um_custom_validate_account’,
      array(‘plain_text’ => 1,’tags’ => array(‘{profile_name}’,'{profile_url}’,),’
      tags_replace’ => array($profile_name,$profile_url,)) ); }add_action(« um_after_save_registration_details»,”
      um_notify_sponsors »,10, 2);
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Not Updraging many Errors](https://wordpress.org/support/topic/not-updraging-many-errors/)
 *  [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/not-updraging-many-errors/#post-16301885)
 * <font _mstmutation=”1″ _msthash=”1030458″>Hello Veronica, I wish very happy holidays
   to the whole team and to you. Quick question, do you have a date for this future
   update?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Mobile layout](https://wordpress.org/support/topic/mobile-layout-18/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/mobile-layout-18/#post-16300344)
 * <font _mstmutation=”1″ _msthash=”1084707″>
 * Hello,
   I succeeded, the error came from my CSS modifications, thank you for your
   tolerance and good match
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] booking link](https://wordpress.org/support/topic/booking-link-2/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/booking-link-2/#post-16298707)
 * <font _mstmutation=”1″ _msthash=”1024283″>Everything works, the problem came 
   from the cache, I erased everything, now no problem, sorry again
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] booking link](https://wordpress.org/support/topic/booking-link-2/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/booking-link-2/#post-16298676)
 * <font _mstmutation=”1″ _msthash=”1108341″>I deactivated all the plugins the problem
   persists I click to validate or reject a reservation, nothing happens but if 
   I right click to open in a new tab it works
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] celebration birthday](https://wordpress.org/support/topic/celebration-birthday/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/celebration-birthday/#post-16248777)
 * good evening Aswin, it’s sending mail that doesn’t work after I don’t know if
   the following syntax is good:
 * key’ => ‘birth_date_45′,’birth_date_45-31’,
 * I have two keys one for hosts and one for women. I don’t know if the blocking
   of sending mail comes from there. Thank you in advance for your assistance
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Frontend Post WordPress Plugin - AccessPress Anonymous Post] Ultimate member](https://wordpress.org/support/topic/ultimate-member-39/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/ultimate-member-39/#post-16232955)
 * Hello,
    Do you have a solution, thank you very much
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Duplicator - Backups & Migration Plugin - Cloud Backups, Scheduled Backups, & More] nitArchiveFilesData is not a function](https://wordpress.org/support/topic/nitarchivefilesdata-is-not-a-function/)
 *  Thread Starter [melchi2](https://wordpress.org/support/users/melchi2/)
 * (@melchi2)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/nitarchivefilesdata-is-not-a-function/#post-16228028)
 * Hello,
 * I solved, the incident came from Loco translate which had to modify the script,
   after deleting the translations, it works

Viewing 15 replies - 1 through 15 (of 93 total)

1 [2](https://wordpress.org/support/users/melchi2/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/melchi2/replies/page/3/?output_format=md)…
[5](https://wordpress.org/support/users/melchi2/replies/page/5/?output_format=md)
[6](https://wordpress.org/support/users/melchi2/replies/page/6/?output_format=md)
[7](https://wordpress.org/support/users/melchi2/replies/page/7/?output_format=md)
[→](https://wordpress.org/support/users/melchi2/replies/page/2/?output_format=md)