Jump to content

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


Norman_12
 Share

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

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

×
×
  • Create New...