wip creating emails

This commit is contained in:
asus
2024-04-02 17:01:25 +02:00
parent 1f5fff26d6
commit 47360119e8
4 changed files with 62 additions and 16 deletions

View File

@@ -0,0 +1,34 @@
<?php
/*
* it means someone outside wp is accessing the file, in this case kill it.
*/
if (!defined('ABSPATH')) {
die('You can not access this file!');
}
function email_success_payment_CIPF($user_id) {
Plgntls::debug_infos();
$user = get_user_by('id', $user_id);
$to = $user->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!');
}
}
?>