英文:
How to get formatted text in gform_notification hook?
问题
我尝试保存已提交的Gravity Forms表单的一些详细信息到帖子中,但问题是当我使用gform_notification
挂钩时,$notification
包含带有合并标签的消息,所以看起来像这样:
名字:
{名字:1}
姓氏:
{姓氏:2}
但我需要实际的值。
如果有人知道如何获取实际发送出去的通知消息,请告诉我。
提前谢谢!
英文:
I try to save some details of a submitted Gravity Forms form in a post, but the problem is that when I use gform_notification
hook $notification
contains the message with merge tags, so it looks like this:
First name:
{First name:1}
Last name:
{Last name:2}
but I would need the actual values.
If anybody has an idea how to get the notification message that actually goes out please let me know.
Thank you in advance!
答案1
得分: 1
GFCommon::replace_variables()
静态方法替换合并标签。
> 通过 GFCommon::replace_variables()
方法运行 $notification['message']
。
英文:
The GFCommon::replace_variables()
static method replaces merge tags.
> Run $notification['message']
through the GFCommon::replace_variables()
method.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论