Jump to content

FormBuilder - send tests to test admins


Peter Knight
 Share

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.

 

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

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