简体   繁体   English

以wordpress重力形式显示带有答案的HTML内容

[英]Show HTML Content with answer in wordpress gravity form

I'm using gravity form in wordpress and I'm facing a problem, I've one HTML content where I write down question 1. Are you presently taking any medications, nutritional supplements or vitamins? Please list (attach sheet if necessary) 我在wordpress中使用重力形式,遇到一个问题,我在一个HTML内容中写下了问题1. Are you presently taking any medications, nutritional supplements or vitamins? Please list (attach sheet if necessary) 1. Are you presently taking any medications, nutritional supplements or vitamins? Please list (attach sheet if necessary) and second one is textarea which has label called Answer: and third field is textfield which has label called Not Important 1. Are you presently taking any medications, nutritional supplements or vitamins? Please list (attach sheet if necessary) ,第二个是标签为“ Answer:文本区域,第三个字段是标签为Not Important文本字段

重力形式问题

So the problem is when I just fill the form and submit it, I get the email every time, below image is email notification which I get every time when ever user submit the form 所以问题是当我只填写表格并提交时,每次都会收到电子邮件,下图是用户每次提交表格时都会收到的电子邮件通知

重力形式

now as you can see I got answer label every time in my email but doesn't get question with answer in email, I've tried many options in gravity form plugin and I also tried this code 现在,您可以看到我每次在电子邮件中都得到答案标签,但是在电子邮件中没有收到关于答案的问题,我已经尝试了重力形式插件中的许多选项,并且还尝试了此代码

$gf_pdf_config[] = array( 'form_id' => 2, 'notifications' => true, 'default-show-html' => true, 'default-show-empty' => true, 'default-show-page-names' => true, 'default-show-section-content' => true, 'template' => 'default-template-two-rows.php', 'filename' => '{date_mdy}_test-payment-patient-form-justinhealth.pdf' );

in configuration.php plugin's file but didn't work for me so is there any solution for it. configuration.php插件的文件中,但对我不起作用,因此有任何解决方案。

As you can see from this old support thread, adding html to the notification email via merge tags wasn't something they intended or were planning to implement. 从这个旧的支持线程可以看到,通过合并标记将html添加到通知电子邮件中并不是他们想要或计划实现的。

https://www.gravityhelp.com/forums/topic/html-block-output-in-email-notifications-and-on-pages https://www.gravityhelp.com/forums/topic/html-block-output-in-email-notifications-and-on-pages

The best bet would be to follow the suggestion by Kevin Flahaut in the thread above and create dummy textarea input fields before each answer textarea, with a default 'answer' which is the text for that question. 最好的选择是遵循凯文·弗拉豪特(Kevin Flahaut)的建议,在每个答案文本区域之前创建虚拟文本区域输入字段,并使用默认的“答案”作为该问题的文本。 Then add a custom css class to all the question textarea fields and apply display: none to that class in your CSS. 然后将自定义css类添加到所有问题textarea字段,并应用display: none到CSS中的该类。

That way the frontend looks like you want it to with the html as the question, the email notification will contain the question textarea inputs which were hidden on the frontend in the order they should appear in. No code required. 这样,前端看起来像您想要的那样,以html作为问题,电子邮件通知将包含问题textarea输入,这些输入按应在其中出现的顺序隐藏在前端中。不需要任何代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM