diff --git a/plugins/cipf_plugin/cipf_plugin.php b/plugins/cipf_plugin/cipf_plugin.php index 2b48db8..9e7a7fc 100644 --- a/plugins/cipf_plugin/cipf_plugin.php +++ b/plugins/cipf_plugin/cipf_plugin.php @@ -28,12 +28,6 @@ include_once( plugin_dir_path(__FILE__) . '/plgntls_class.php'); include_once(Plgntls::root_path() . 'php/utils/globals.php'); include_once(Plgntls::root_path() . 'php/utils/console_log.php'); -include_once(Plgntls::root_path() . 'php/admin_menu/admin_menu.php'); -include_once(Plgntls::root_path() . 'php/admin_menu/admin_menu_toggle.php'); -include_once(Plgntls::root_path() . 'php/admin_menu/menu_content.php'); -include_once(Plgntls::root_path() . 'php/admin_menu/post_paypal.php'); -include_once(Plgntls::root_path() . 'php/admin_menu/post_payment_messages.php'); - // paypal include_once(Plgntls::root_path() . 'php/paypal/paypal.php'); // profs @@ -53,6 +47,7 @@ include_once(Plgntls::root_path() . 'php/display_css.php'); include_once(Plgntls::root_path() . 'php/payments.php'); include_once(Plgntls::root_path() . 'php/random_posts.php'); include_once(Plgntls::root_path() . 'php/scheduled_events.php'); +include_once(Plgntls::root_path() . 'php/emails.php'); // admin include_once(Plgntls::root_path() . 'php/admin_hide_bar.php'); include_once(Plgntls::root_path() . 'php/admin_user_profil.php'); @@ -154,6 +149,22 @@ vous allez être redirigés vers votre espace', vous allez être redirigés vers votre espace', ], ]; + const OPTION_EMAILS = [ + '_name'=>'cipf_emails_option', + '_callback'=>'update_emails_settings_option_CIPF', + '_default'=>[ + [ + 'action'=>'success_payment', + 'notification_send'=>true, + 'notification_to'=>'test', + 'notification_subject'=>"paiement réussi", + 'notification_message'=>"par ici la monnaie", + 'confirmation_send'=>true, + 'confirmation_subject'=>"paiement réussi", + 'confirmation_mesage'=>"donne l'argent", + ], + ], + ]; // ADMIN MENU diff --git a/plugins/cipf_plugin/php/emails.php b/plugins/cipf_plugin/php/emails.php new file mode 100644 index 0000000..2415991 --- /dev/null +++ b/plugins/cipf_plugin/php/emails.php @@ -0,0 +1,34 @@ +user_email; + $subject = 'My Custom Email Subject'; + $message = 'Hello, This is a test email sent from my WordPress plugin!'; + $headers = array('Content-Type: text/html; charset=UTF-8'); + + $sent = wp_mail($to, $subject, $message, $headers); + + // Check if the email was sent successfully + if (!$sent) { + error_log('Email sending failed!'); + } +} + + + + + +?> diff --git a/plugins/cipf_plugin/php/paypal/update_user_payment.php b/plugins/cipf_plugin/php/paypal/update_user_payment.php index d174195..85545e6 100644 --- a/plugins/cipf_plugin/php/paypal/update_user_payment.php +++ b/plugins/cipf_plugin/php/paypal/update_user_payment.php @@ -171,6 +171,7 @@ function success_payment_for_user_CIPF($user_id, $order_id) { set_payment_success_CIPF($user_id); set_account_valid_CIPF($user_id); + email_success_payment_CIPF($user_id); } diff --git a/plugins/cipf_plugin/php/scheduled_events.php b/plugins/cipf_plugin/php/scheduled_events.php index 0646086..e1b9ecc 100644 --- a/plugins/cipf_plugin/php/scheduled_events.php +++ b/plugins/cipf_plugin/php/scheduled_events.php @@ -31,17 +31,17 @@ if (!defined('ABSPATH')) { */ /* -* events : +* events and emails : * -* - payments : : suppress old order_ids -* - profs : email : validation payment prof, send email -* - profs : email : validation transfert prof, send email -* - partners : : offres temporaires -> gerer qu'elles disparaissent apres la date de validite -> la passer en masquer -* - partners : : la gestion des offres à échéance -* - payments : email : schedule event pour supprimer le compte xx temps (6 mois ?) apres fin de validite de la carte -* - payments : email : schedule event pour supprimer les codes -* - payments : email : schedule event pour desactiver la carte -* - payments : email : faire rappels emails +* - payments : action : : suppress old order_ids +* - profs : : email : validation payment prof, send email +* - profs : : email : validation transfert prof, send email +* - partners : action : : offres temporaires -> gerer qu'elles disparaissent apres la date de validite -> la passer en masquer +* - partners : action : : la gestion des offres à échéance +* - payments : action : email : schedule event pour supprimer le compte xx temps (6 mois ?) apres fin de validite de la carte +* - payments : action : email : schedule event pour supprimer les codes +* - payments : action : email : schedule event pour desactiver la carte +* - payments : action : email : faire rappels emails * * *