carousel form

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

carousel form

Post 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.
Kind regards,
HarmO
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: carousel form

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: carousel form

Post 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?
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

Re: carousel form

Post 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.
Kind regards,
HarmO
Post Reply

Return to “The Lounge”