通过电子邮件链接访问 WordPress 页面
我有一个 Wordpress 网站,我想做的是让用户通过表单发送他们的电子邮件地址,然后我的电子邮件客户端会自动向他们发送带有特定页面链接的消息。如果没有该链接,则不应访问该页面。这可以做到吗?有没有现成的插件可以做到这一点?我使用会员插件,但我希望用户只提供他们的电子邮件而不是填写整个表格。希望你理解。谢谢。 w
I have a Wordpress site and what I would like to do is for users to send their email address through a form and then my email client would send automatically message them with a link to a certain page. That page should not be accessable without that link. Is that possible to do and are there any ready plugins for this? I use a members plugin, but I want users only to give their email and not to fill out a whole form. Hope you understand. Thanks. w
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更好的途径是仅使用内置的注册系统。有什么原因对你不起作用吗?
除此之外,这里有一个快速而肮脏的方法...
要向用户发送邮件,只需将以下 PHP 代码放入页面中:
第一个参数假设调用此代码的页面有一个名为“user_email_address”的文本框。邮件的主题和内容如下;您可以更改它们以反映您真正想要的内容。
然后,在要限制访问的页面上,将以下代码放在文件顶部:
这将重定向没有 get 参数访问权限的任何人。该系统有两个主要缺点:
如果您提供有关内置注册系统为何不起作用的更多详细信息,我也许可以提供更好的帮助。
-凯文
The better route is to just use the built-in sign-up system. Is there some reason that didn't work for you?
Short of that, here is a quick and dirty approach...
To send mail to a user, just put the following PHP code in a page:
The first parameter assumes the page that calls this has an textbox with the name 'user_email_address'. The subject and content of the mail follow; you can change them to reflect what you reallyw ant.
Then on the page you want to restrict access to, put the following code at the top of the file:
This redirects anyone who doesn't have the get parameter access. This system has two main shortcomings:
If you provide more details on why the built-in registration system didn't work, I might be able to help better.
-Kevin