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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • 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 🙂
    • By BFD Calendar
      We're looking for someone who can make an addon for our website using Formbuilder and publishing the pages to a Google Calendar instantly.
      The use is a setup for laser reservations for a modelbuilding lab, see www.mekano.info to have a bit of an idea. On the 'calendar' page you'll find a linked Google calendar that lists all events per day. These events are now all added by staff members in a shared Google calendar. Underneath the calendar is a list of recent use of our lasercutters, generated by a form where user, machine and start time are entered and duration is calculated by editing that form. I have a likely form to add a reservation to enter user, machine and time/date but we want them to go into our shared Google calendar 'immediately'. If you look at early June in the calendar you can see how it should look like.
      I know there are simple solutions to make this happen but haven't figured a working out.
      We want Google calendar so all our staff can subscribe and see the calendar on all their devices. On the other hand we want to keep a list of students who made reservations because at some point they are limited.
      If you're interested I can give you a login to see a bit more behind the curtains. Part of the website is public for students and guests, quite a few functional pages are only visible when you're logged in.
    • By DooM
      Hey guys,
      I'm using Form builder module by Ryan and I'm trying to render HTML success message after form is sent using value from this field:

      but it renders exactly as it is written in the field, not as HTML. To render it I just use echo
      <?= $successMessage ?> What am I missing?
       
      Thanks for any help. 🧒
    • By Sergio
      Confession bear meme on tests: I'm a virgin.
      Never implemented any of them, mostly because I work alone for many years now. But found this cool project today, called Cypress. 
      This is the easiest way to test a website or app I've found. Check their intro video out: https://docs.cypress.io/guides/getting-started/writing-your-first-test.html
      Note: I recommend this Chrome extension to speed up videos: https://github.com/igrigorik/videospeed as the narration of this video is kinda slow. 🙂
       
    • By J_Szwarga
      What is the best practice for having a form (only accessible to a logged in user) save the user's progress between sections of the form? Fieldsets? Multiple forms?
      Use case: I have a very long application form that would take 30 minutes for the applicant to fill out and I would hate for all progress to be lost due to user error. The progress needs to be logged into the user's page.
      Thanks!
×
×
  • Create New...