Include variable in custom new user registration email
-
Hi
I’ve been using wp_new_user_registration (code from Stackexchange here) to send a customised email to new users who register. I wrote a very quick plugin to achieve this, which works fine.
What I’m trying to figure out is how to include the URL of the page that the user was on before they got to the login page (people have to register to see certain content, so I want to include the URL to enable them to get back to the page they were on).
I’ve figured out how to display the URL on a page/template, by appending the referring page (eg. https://mydomain.com/?referer=https://mydomain.com/somepage ) using $_GET or a query_var, but I can’t figure out how to pass that to the function that sends the email to new users.
I’ve tried adding an action to ‘register_post’ but with no luck.
I’ve put my code so far in pastebin: https://pastebin.com/pD9CeHsA
Any pointers would be much appreciated!
- The topic ‘Include variable in custom new user registration email’ is closed to new replies.