mosselmansoftware
Forum Replies Created
-
No problem at all, I’m also very glad this solution worked.
I have been testing 4 other member plugins that all didnt quite work how i wanted it.
Then I tested ultimate members, it worked for what my client needed. But some minor issues like this are a bit frustrating.Hi @adcapaust
You can remove the if statement in the first functions if you dont use that.
In my case It will send a new user 2 mails, 1 from wordpress and 1 from ultimate members and I want to make sure my client will never have the ability to do that. So i just filter that email.
add_filter('wp_mail', 'prevent_duplicate_user_notification_email'); function prevent_duplicate_user_notification_email($args) { // Check if the email is a new user notification email with the specific subject if (strpos($args['subject'], '{specific subject you can remove this if statement if you want.}') !== false) { $args['to'] = ''; //Set adress to empty string so it wouldnt get send. } // Modify the email image urls $args['message'] = modify_email_image_urls($args['message']); return $args; } function modify_email_image_urls($content) { // This pattern matches image URLs that start with "//" $pattern = '/<img[^>]+src="\K\/\/[^"]+/'; // This is the callback function that prepends "https:" to the URL $callback = function ($matches) { return "https:" . $matches[0]; }; return preg_replace_callback($pattern, $callback, $content); }Yes, of course. I will share the script when i get home in a hour.
I ffound the problem.
When i put <i> with source https://(imgurl) and i save it, plugin will change the sourceurl to //(imgurl) and then it wouldnt show up in the email.
I now made a custom script in functions.php to replace outgoing email source link to add https. But this cant be the proper solution.