Files
2024_WEBSITE_fipf/plugins/cipf_plugin/php/emails.php
2024-04-02 17:01:25 +02:00

35 lines
638 B
PHP

<?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!');
}
}
?>