emails in progress

This commit is contained in:
asus
2024-04-03 16:23:14 +02:00
parent 19fc5f17a6
commit 1628eac171
2 changed files with 40 additions and 10 deletions

View File

@@ -89,16 +89,6 @@ function replace_words($matches, $user_id = null) {
function filter_email_wp($args) {
// pattern : anything surrounded by '$$', ex : $$value$$
$pattern = '/\$\$(.*?)\$\$/';
error_log("email args: " . json_encode($args));
/*
email args: {
"to":"ruknafetri@gufum.com",
"subject":"My Custom Email Subject",
"message":"Hello, This is a test email sent from my WordPress plugin!",
"headers":["Content-Type: text\/html; charset=UTF-8"],
"attachments":[]
}
*/
$old_to = $args['to'];
$new_to = preg_replace_callback($pattern, __NAMESPACE__.'\replace_words', $old_to);