Jump to content

Form Builder - Now Available


ryan

Recommended Posts

Hi Ryan

I downloaded the FormBuilder module yesterday and it is brilliant. Thanks for making this.

I'm having a little problem though. When I tick the "Send an email to administrator(s)" checkbox and drop in an email address, that email address doesn't receive a copy of emails submitted through the form. I've tried a few different emails with no luck.

Any ideas on how I might fix this? Ideally, I'd like my client to receive an email when someone tries to contact them using the contact form I've created.

Thanks

Link to comment
Share on other sites

  • 5 years later...
On 2/24/2020 at 11:28 AM, rooofl said:

Hello,

I need users to add new entries to a page reference field, just like a “Create New” action. Is that possible in a form?

I solved that with a hook in `site/ready.php`

<?php
$forms->addHookBefore('FormBuilderProcessor::processInputDone', function($e) {
  $form = $e->arguments(0);
  if($form->name == 'new_submission') {
    $pageTitle = "test";
    $toFind = wire(pages)->find("title=$pageTitle");
    if (count($toFind) == 0) {
      $page = new Page();
      $page->parent = "/config/designer/";
      $page->template = "designer";
      $page->title = wire(sanitizer)->text($pageTitle);
      $page->save();
    }
  }
});
?>

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...