wip creating emails
This commit is contained in:
34
plugins/cipf_plugin/php/emails.php
Normal file
34
plugins/cipf_plugin/php/emails.php
Normal 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!');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user