简体   繁体   English

php-动态电子邮件地址变量Wordpress

[英]php - Dynamic email address variable Wordpress

I'm quite a newbie in php and I got stuck. 我是php的新手,被卡住了。 I would like to create a dynamic email variable which will take email address from a current user and insert it into a link. 我想创建一个动态的电子邮件变量,它将获取当前用户的电子邮件地址并将其插入链接。 It will be used to sign up for a mailing list. 它将用于注册邮件列表。 My mailing list service provided me with instructions to use this code: 我的邮件列表服务向我提供了使用此代码的说明:

<?php

$email =
$kod = MD5($email.”SECRET CODE“);
file(“http://www.samplesite.com/get.php?uid=YOUR_UIDemail=$email&kod=$kod&”);
?>   

I previously used 我以前用过

<?php 
 global $current_user;
 get_currentuserinfo(); 
echo    $current_user->user_email ; ?>

to obtain current user email for different things but in this instance its impossible. 获取当前用户电子邮件的其他信息,但在这种情况下是不可能的。 Any suggestions? 有什么建议么?

Please check this url for getting the current user email 请检查此网址以获取当前用户的电子邮件

https://codex.wordpress.org/Function_Reference/wp_get_current_user https://codex.wordpress.org/Function_Reference/wp_get_current_user

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM