Jump to content

How to store all the submitted emails in one page and in a table ?


Recommended Posts

Hi Guys im using Processwire 2.7.2  and still discovering the platfom.

is it possible to store all the submitted email in a one page table instead of each page for each submitted email ?

Looking forward to hear your thoughts

Link to comment
Share on other sites

If you are talking about displaying all the emails in a table, then you can just use the PW API to fetch the children of the contact form page and display them in an HTML5 table.

If you can let us know what contact form you are using, maybe we could point you further towards a solution.

Also, could you just post the screenshots here in the forum rather than links to screen shots stored elsewhere.

  • Like 1
Link to comment
Share on other sites

PW isn't a system that automatically collects emails, so I actually have no idea what you are talking about now. If you didn't install a contact page, who did?

The link you posted above doesn't seem to work for me, could you post the actual screen shot you took here please.

Link to comment
Share on other sites

35 minutes ago, Norman_12 said:

Nobody installed any module

Then someone has coded a template file with the logic for the contact form!? Who, or how does it looks like?

Link to comment
Share on other sites

If the system is working well, and all you want to change is this detail, you can can use the Page Table field (it's in the core, you just have to install it). If all you want is to have an easy way to look at those contacts, and don't mind still having those pages as children, just create a "ProFields: Page Table" field, set "Select one or more templates for items" to "contact", and leave "Select a parent for items" empty.

Then add this to your code right after $p->save();

$contacts_page = $pages->get("/contact/");
$contacts_page->of(false);
$contacts_page->contacts->add($p); // assuming the name of the new field is "contacts"
$contacts_page->save();

If, for any reason, you don't want the pages as children of the contacts page, you can create a page only for this purpose, and set it as the value to "Select a parent for items" in the field. Then you just have to replace $pages->get("/contact/") in the code by the correct parent.

 

 

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

When you click the edit icon on those rows, does it open a contact page? Also, in the "Table fields to display in admin"area, did you write the names of the fields exactly, including text case, as they are stated on the yellow note below it?

Link to comment
Share on other sites

Hi @diogo Your solution worked fine and in i really thank you for that.

i have like one more question if you please, How to export the data stored in my  "ProFields: Page Table" field in a CSV file ?

Looking forward to hear your thoughts

export.PNG

Link to comment
Share on other sites

Just follow the instructions on those messages. Add one of the suggested options to the end of your config.php file. This file is situated in the "site" directory of your Processwire install.

Be aware that the debug option should be used only only on non public websites, so don't forget to remove it when you publish. Or just use the second option to always allow installing modules via upload. You can also add modules manually via ftp, as you can see on the bottom of your screenshot. Make sure to get yourself acquainted with how to install modules https://modules.processwire.com/install-uninstall/

  • Like 1
Link to comment
Share on other sites

Interesting, should work, but can you try with the debug option instead?

You can also with the manual option if that doesn't work. It would at least get you going with the work while you check what's wrong with this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By rareyush
      <?php namespace ProcessWire; $form = $modules->get('FormTemplateProcessor');$form->template = $templates->get('book-now'); // required $form->requiredFields = array('title', 'email', 'number','body'); //$form->email = 'your@email.com'; // optional, sends form as email $form->parent = $page('template=book-now'); // optional, saves form as page //$form->render(); // draw form or process submitted form ?> <?php echo $form->render(); ?>  
       
      using this to for a contact on new processwire version 3  and I am receiving this error
       
      Error: Uncaught Error: Call to undefined method stdClass::render() in C:\wamp64\www\mbs\site\templates\book-now.php:9  
      tried following but none of them works
       
      render(array('name','email','body',))
      wireRender()
       
      Render()
      wire()
       
      anyone ?  
    • By rareyush
      I created a template where I am rendering this php file where I am saving contact quires in a template and it is working fine in homepage.
      I used my same code in another page on a same project by creating another template and rendering another file but I am receiving this error again and again, I tried to figure out but it not working.
       
      <?php namespace ProcessWire; $form = $modules->get('FormTemplateProcessor');$form->template = $templates->get('contact'); // required $form->requiredFields = array('title', 'fullname','email_form', 'mobile', 'message'); //$form->email = 'your@email.com'; // optional, sends form as email $form->parent = $page('template=contact-form'); // optional, saves form as page $form->render(); // draw form or process submitted form ?> <?php echo $form->render(); ?>  
      error I am receiving 
       anyone can any solutions for it ?
    • By rafaoski
      Hello All ... I just added a new Site Profile ...
      It is important that you use the latest version that supports the new Fields => Fieldset in Tab , Fieldset ( Page ) for this time it is version 3.0.83 DEV
      A simple profile for quick start new Page ... There are several pages like About Us, Blog, Portfolio, Contact Page ...
      The profile is not based on any framework, I just used some css, flexbox, grid, font awesome, and added a simple FlexBox Grid called GRIDLEX ...
      CAN DOWNLOAD FROM THIS LINK:
      http://modules.processwire.com/modules/site-twilight/
      https://github.com/rafaoski/site-twilight
      Some Screenshots:

      OPTIONS PAGE:

      CONTACT PAGE:

      BLOG PAGE:

      ABOUT PAGE:

      PORTFOLIO PAGE:

       
      In addition, I added 2 great modules:
      Tracy Debugger:
      https://modules.processwire.com/modules/tracy-debugger/

      Markup Sitemap:
      http://modules.processwire.com/modules/markup-sitemap/

       
    • By rushy
      Hi. I have a contact page form that collects user queries in the usual manner and when validation is ok it does a method = post with action = contact-form.php to execute the sending of mail from the server.
      This is all fine and works well, but when the sending is done, I would like a landing page in my project to be displayed. How would i do that? I've tried adding PW code to the contact-form.php to invoke my landing page but I think this is not in scope as nothing happens.
      Many thanks for any guidance.
      Paul
       
×
×
  • Create New...