Edit the user activation email for registration
-
Hi there,
I’m trying to edit the message that gets sent by WP to the user when they register and need to click the activation link. I see in the link below that Forminator edits the link info in the email before it gets sent.
https://docs.hookmax.com/plugin/forminator/1.16.2/class/Forminator_CForm_User_Signups/#I found a mu-plugin workaround to change the email but it’s only changing the subject and not the message content so I think it’s something in Forminator that is making it not work. I asked the guy who made it and he said it’s probably Forminator doing something. He did say something about the priorities for the hook but I got no idea.
This is what I have for the code. Do you know how it can be fixed to make it work?
I edited the activation link part to “?page=account_activation&key=$key” as that what comes in the email but nothing.
Thanks.<?php /** * Plugin Name: Custom Activation Email * Description: Change what is sent for the email activation. */ add_filter('wp_mail_from', 'new_mail_from'); add_filter('wp_mail_from_name', 'new_mail_from_name'); function new_mail_from($old) { return 'SENDER EMAIL'; } function new_mail_from_name($old) { return 'SENDER NAME'; } add_filter( 'wpmu_signup_user_notification_subject', 'my_activation_subject', 10, 4 ); function my_activation_subject( $text ) { return 'Activate your account for SITE NAME'; } add_filter('wpmu_signup_user_notification_email', 'my_custom_email_message', 10, 4); function my_custom_email_message($message, $user, $user_email, $key) { $message = sprintf(__(( "To activate your new account, please click the following link:\n\n%s\n\n After you activate you will be able to log in.\n\n" ), $user, $user_email, $key, $meta),site_url( "?page=account_activation&key=$key" )); return sprintf($message); }
- The topic ‘Edit the user activation email for registration’ is closed to new replies.