【问题标题】:Transaction id in email notification gravity form电子邮件通知重力表单中的交易 ID
【发布时间】:2023-04-01 11:41:01
【问题描述】:

我需要帮助才能在以重力形式发送给管理员的通知电子邮件中插入交易 ID,

【问题讨论】:

  • 我想在插入合并标签下拉列表的重力形式的条目部分中插入交易。

标签: php wordpress gravity


【解决方案1】:

您需要将其添加到主题的 functions.php 文件中:

add_filter( 'gform_replace_merge_tags', 'replace_transaction_id', 10, 7 );
function replace_transaction_id( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) {
    $transaction_id = empty( $transaction_id ) ? rgar( $entry, 'transaction_id' ) : $transaction_id;
    $text = str_replace( '{transaction_id}', $transaction_id, $text );
    return $text;
}

然后,您可以将以下合并标签添加到您的重力形式通知区域:

{transaction_id}

希望这对您有所帮助,尽管距离您的问题已经很长时间了,但我一直在 Google 上搜索此答案并来到此页面,然后最终找到了答案,所以我在这里分享。

【讨论】:

  • 谢谢!这正是我需要使用 Gravity Forms 从 Payeezy 提取交易 id 的内容。
猜你喜欢
  • 2019-02-23
  • 2014-10-28
  • 1970-01-01
  • 2013-11-21
  • 1970-01-01
  • 1970-01-01
  • 2019-01-12
  • 1970-01-01
  • 2015-05-20
相关资源
最近更新 更多