已发送邮件中的动态链接 [英] dynamic link inside Sent mail

查看:88
本文介绍了已发送邮件中的动态链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个邀请页面,该页面的成员可以向任何人发送简历
受邀者会收到带有某些链接的电子邮件
一个链接用于接受此邀请
另一个名为(取消订阅)的链接
我想在使用点击时更改此链接文本

问题是我无法做到这一点,因为已发送的邮件是作为文件后面的代码内部的字符串完全创建的,因此我真的需要帮助,示例代码

非常感谢

i have an invitation page , from this page member can send invitaions to anybody
the invited person get an email with some links
one link is for accept this invitation
the other link named (Unsubscribe)
i wanna change this link text on use click

the problem is that i cant do that as the sent mail is fully created as a string inside code behind file, i really need help in that with sample code

thank a lot

推荐答案

我将这样进行:
-由于每条邀请都是在服务器上生成的,因此我会为其生成一个长而唯一的随机ID
-我会将ID与被邀请者数据一起存储在数据库中,并存储一个"subscribed"标志
-我会将这个ID作为参数添加到链接中,例如:
<a href="http://www.site.com/?subscribe=thegeneratedid">Subscribe</a>
<a href="http://www.site.com/?insubscribe=thegeneratedid">Unsubscribe</a>
当被邀请者单击订阅链接时,服务器将为他设置标志和欢迎消息.如果他已经被订阅,它将显示一条正确的消息.对于取消订阅链接,它的工作原理类似,但是效果相反.
但是我不会在同一封邮件中添加两个链接.邀请只能包含订阅链接,订阅确认邮件可以包含取消订阅链接.
I would proceed like this:
- As every invitation is generated on server, I would generate a long, unique, random ID for them
- I would store the ID in the database along with the invitee data, and a "subscribed" flag
- I would add this id as parameter in the links, like this:
<a href="http://www.site.com/?subscribe=thegeneratedid">Subscribe</a>
<a href="http://www.site.com/?insubscribe=thegeneratedid">Unsubscribe</a>
When the invitee clicks on the subscription link, the server would set the flag for him, and a welcome message. If he is already subscribed, it would display a proper message. And it would work similary for the unsubscribe link, but of course with opposite effect.
But I would not add both links in the same mail. The invitation could contain only the subscribe link, and the subscription confirmation mail could contain the unsubscribe link.


这篇关于已发送邮件中的动态链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆