Page 1 of 1

carousel form

Posted: Mon Oct 16, 2017 7:57 pm
by HarmO
Hi,

I'm working on a website that needs to send a form to a carousel of receivers

I'll explain with an example:
I have a list of 12 people.
Every time the form gets submitted, it needs to be emailed to the next 5 persons of the list.
  • first submit: sent to contact 1 to 5
  • second submit sent to contact 6 to 10
  • third submit: sent to contacts 11,12 and 1 to 3
I was wondering if someone made this already or has an idea how we can create this.

Re: carousel form

Posted: Mon Oct 16, 2017 9:59 pm
by calguy1000
This certainly calls for some custom code. A UDT disposition in CGBetterForms would handle it.

You need:
a: the list of recipients
b: a static counter that gets incremented with each form submit. a site preference would work fine for this.

You also have to handle the occasion that there is a wraparound:
i.e: you have 27 emails in the recipient list and this is the 7th time the form was submitted. Not difficult, but requires a bit of logic.

Re: carousel form

Posted: Tue Oct 17, 2017 6:57 am
by velden
regarding b.: Perhaps this FormBuilder field can be used too:
Unique Integer (Serial). This is an integer that increases every time someone hits your form. Your results may not be sequential, but they will increase monotonically.
Though 'not sequential' may not be desired in this case, and it seems the field is already filled on form display. While you may want to have the number 'generated' on submission. Especially on a site where multiple forms may be filled at the same time by different visitors.

Out of curiosity: what's the specific use case for this rotating recipients?

Re: carousel form

Posted: Wed Oct 18, 2017 7:08 am
by HarmO
@Calguy1000 and @Velden: Thank for the reaction.

I already thought it would require custom code :-). Where can i find documentation on using site preferences and how to modify them with code?

@Velden: the usecase is a website where visitors can request service quotes. The visitors query is then sold to up to 6 companies.