Jump to content
Peter Knight

FormBuilder - send tests to test admins

Recommended Posts

I have a few web forms which require testing on a weekly basis and I don't want the recipients (administrators) to receive these test emails.

What would be a good way to test approx 15 forms from the front end and have the test delivered a list of secondary administrator recipients?

I'm thinking that I could have some kind of config file which watches for a trigger word or email and then understands that it's a test and to bypass the normal admins?

All of the forms ask for an email address so I could setup an email such as 'testform@email.not' etc which my config file (hook?) would watch for.

Or is there a better way to do this?

Additionally, I have a few extra requirements...

  1. Forms should goto an alternative success page. This is because I don't want my test to skew my Google Analytics conversion tracking
  2. Forms would need to be tested from the front-end and not the PW admin area

Any advice appreciated.

BTW I realise this should be posted in the proper FormBuilder support forum. I am in the process of renewing my license for access to that support forum.

 

Share this post


Link to post
Share on other sites
4 hours ago, Peter Knight said:

I'm thinking that I could have some kind of config file which watches for a trigger word or email and then understands that it's a test and to bypass the normal admins?

 

Or a query param if you set the forms to use the url params?

Otherwise sound like a plan, check for a specific email and just update the form settings you need to, before processing. I haven't really been exactly in your scenario, but a hook does feel like the best option here and have used hooks extensively to hack form builder and works wonders.

I then use either a chrome extension to fill the forms, for example this extension always uses the domain "xxx@mailinator" . Or write a small javascript that fills the forms and I call it from the browser console if i need more control.

Share this post


Link to post
Share on other sites
6 hours ago, Peter Knight said:

require testing on a weekly basis

Why do you need to test them so often?

The obvious advice would be: Test them on the development instance of the site.

Depending on embed method (A-D), a query string may or may not work.

Perhaps with a hook that checks for user-role?

$this->addHookBefore('FormBuilderProcessor::emailForm', $this, 'testEmails');

protected function testEmails(HookEvent $event) {
	/* @var InputfieldForm $form */
	$form = $event->arguments(0);
    if ($user->hasRole("email-tester") && $config->emailTesting === true) {
 	    $recipient = $form->getChildByName('recipient');
	    $recipient = 'foo@admin.com'; // or put inside $config too
        // some re-definition of the landing page, e.g. add query string or pseudo-landing page, or real-landing-page-url + url-segments /test-only/
    }
}

 

  • Like 2

Share this post


Link to post
Share on other sites
On 11/4/2019 at 6:23 PM, dragan said:

Why do you need to test them so often?

The obvious advice would be: Test them on the development instance of the site.

Depending on embed method (A-D), a query string may or may not work.

Perhaps with a hook that checks for user-role?


$this->addHookBefore('FormBuilderProcessor::emailForm', $this, 'testEmails');

protected function testEmails(HookEvent $event) {
	/* @var InputfieldForm $form */
	$form = $event->arguments(0);
    if ($user->hasRole("email-tester") && $config->emailTesting === true) {
 	    $recipient = $form->getChildByName('recipient');
	    $recipient = 'foo@admin.com'; // or put inside $config too
        // some re-definition of the landing page, e.g. add query string or pseudo-landing page, or real-landing-page-url + url-segments /test-only/
    }
}

 

Thanks @dragan. Nice idea re. checking via user role.

Quote

Why do you need to test them so often?

The forms generate a significant amount of web leads and are under heavy usage. Typically any enquiry needs to successfully route through all of the following which all need to be working perfectly

1. the website itself and the form
2. any SMTP configuration module
3. Our SMTP mail delivery service
4. Client's end email address

We had an incident recently whereby the SMTP mail delivery service had a bounce from a client email address due to an IT outage. It then incorrectly flagged an organisation as inactive and stopped sending all future leads. The represents wasted leads but also wastage of AdWords budget etc.

So essentially it's an SLA thing for reassurance to make sure everything is working.

  • Like 1

Share this post


Link to post
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.

  • Similar Content

    • By benbyf
      I have a a form in my site footer that can be accessed anywhere on site, I've added the form in the _inc.php file and added the render in the pages footer.php. However, this works well on the homepage e.g. you can submit said form and get a thank you on reload, doesnt work at all on other pages... Just lots like a fresh reload. Any thing im doing wrong here or ways to diagnose as there isn't an error log for formbuilder etc...?
    • By neophron
      Hi,
      I hope, this is the right place for questions about the Formbuilder (I couldn't find in the ProField support a subsection for the Formbuilder).
      A client needs for his website a random generator of a code (as winning numbers). This generator should be placed in a simple form (name and email) and a random generated code should be visible there.
      This code, or winning number, must be stored in the db together with the name and email. And the participant must receive a confirmation email with this code.
      I know, that the Formbuilder can store and send data to the user. But what about a random generated code? Is this a hook job?
      I found this module: http://modules.processwire.com/modules/process-field-generator/ but it's not for PW 3. 
    • By prestoav
      Hi folks.
      I'm building a Formbuilder form to create new advert pages in a marketplace. Formbuilder is ideal for this. I need to add a description field that allows text to be added with line breaks etc. so showing a CKEditor field would be ideal (i.e. exactly like the field I'm typing into right now)!.
      Does anyone know if it's possible to add a CKEditor field to the front end presentation fo a Formbuilder field, maybe via a module or such?
      Many thanks!
    • By Chris B
      Hi,
      My name is Chris, i have been using Processwire for several months. I had the opportunity to create several sites with this one. Despite being great tool, I often encounter the same problem in the administration.
      I am continually disconnected (logout) for no specific reason. It's every time: after a page change. Ex: I send a form or simply a page change via a link.
      I checked the logs, messages, etc. but there is nothing related to this problem.
      Thank you for your support 🙂
×
×
  • Create New...