为两个合并记录创建唯一 ID
好吧,这是我令人困惑的问题......在我的每个客户记录信息页面中,我都有一个动态的电子邮件模板列表,这些模板是使用 foreach 和平的 php 代码生成的。当我查看客户记录时,我可以单击电子邮件模板,然后将当前客户的详细信息加载到会话中。
列表中的每个电子邮件模板都动态包装在标签中,并链接到电子邮件模板加载器。
电子邮件模板的 ID 是 url 的一部分,如 token=echo ID,因此,如果我正在查看客户端,我会从列表中单击电子邮件模板,电子邮件模板加载器会使用 url 中的 ID 将模板加载到表单字段中,另外还从会话数据中提取客户端信息。
当按下发送按钮时,填写好的表单字段将通过电子邮件发送。
我遇到的问题是在查看客户页面中,每个动态模板链接旁边都需要是最后一次向客户发送电子邮件的时间。
我遇到的问题是......每次向客户发送带有模板的电子邮件时,电子邮件都是通过模板和客户信息的合并动态创建的,因此我需要创建一些东西来连接可以回显的两者在任何时间作为日期,我不确定是否可以为这两个记录创建一个唯一的 id 来表示整个两条记录,问题是该对的它必须保持相同,所以如果我回来6个月后再次发邮件给他们,记录会更新并且不重新创建,还需要将其他模板与其他客户端等连接的记录,所以我有点困惑。
我不确定是否有更简单的方法可以做到这一点,是否可以使用 jquery 更轻松地完成,例如,当单击模板时,会记录用户 id 和模板 id。
这是查看客户端页面:
这是信息加载到的表单:
Ok, this is my confusing problem......In each of my client record info pages I have a dynamic list of email templates that are generated with a foreach peace of php code. When I am viewing a client record I can click an email template and the details of the current client are then loaded into a session.
Each email template in the list is dynamically wrapped in an tag and links to a email template loader.
The ID of the email template is part of the url as token=echo ID, so if I am viewing a client, I click an email template from the list and the email template loader loads the template into form fields using the ID in the url, plus also pulls in the client info from the session data.
When the send button is pressed, the completed form fields are then emailed.
The problem I have is in the view client page, next to each one of the dynamic template links needs to be the last time the client was emailed.
The problem I have is....each time a client is emailed with a template, the email is dynamically created from the merging of the template and the client info so I need to create something to connect the two that can be echo'd out at any time as a date, im not sure if its possible to create a unique id for the two to represent the two records as a whole, the thing is it would have to stay the same for that pair, so if I came back in 6 months and emailed them again, the record would be updated and not re created, records to connect the other templates with other clients etc would also be needed, so im a bit consused.
Im not sure if there is an easier way of doing this, whether it can be done easier with jquery, e.g when the template is clicked, the user id and template id are logged.
This is the view client page :
This is the form the info is loaded into :
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以在运行时使用 uniqid 在 PHP 中创建唯一的 id
It's possible to create a unique id in PHP at runtime using uniqid