9 years ago
24
Topic

hello everybody,

I'm new on seblod but I think it can do amazing think so I've started to understand how it works.

Just now I would need to create in my joomla website 2 forms.

One of them has to be filled in from new members and it will contains several fields, like city, name etc.

The second will be used from client to send a request to the members.

My question is, is it possible to set the second form in a way that it will be able to send the request mail from the clients only to the members who are on the city selected by the client?

Here an example to clarify my needs:

the are 3 members from Rome and 1 from Milan that registered with the first form. A client fill in the second form and in the field of the city select Rome.

What I need is that this second form will be sent automatically, when the client click on submit, only to the 3 members from Rome and not to the one from Milan.

I got how to use the joomla registration and add the fields that I need so the first form it' ok, but I cannot find a way to create the second form and make it send the mails based on the selected city. I'm not a programmer so I cannot use php or other languages besides than html and css.

I'll appreciate if anyone will take some time to help me in this matter

Get a VIP membership
9 years ago
1
Level 1

Hi, kief

What comes to my mind "offhand":

  1. to use JS. In hidden position you can render a list module with all your users  - you need user_city and user_email fields. After client chooses his city your JS trigger copies all user_email fields values to special textarea. You just put this textarea field to FROM setting of your EMAIL field. Minuse of this method - bid list of users in html
  2. To use core42 field. Before Store you have a filled sity - so you can made request of all emails from this city and put the result to $_POST array to the value of special textarea which is source for FROM setting of your EMAIL field.

I didn't try these methods, but you can try and report us about result.

9 years ago
0
Level 2

Thank you guys for your hint... but if is not to much...could you be more specific in how I can get this done? ...it's my bad... I know...but I still can't code JS, SQL or PHP...I've just started studing and on the SEBLOD manuals and tutorials I couldn't find a solution

@Ilya: I spent the day trying to figure it out how to put what you suggest in practice... ,

I went to research the core42 field but I'm still stuck.

I suppose I should put the code on the "PrepareForm" area but what code should I put?

I was thinking in something like (please dont' laugh) ;)

SELECT users.email FROM users JOIN cck_store_item_users ON users.id = cck_store_item_users.id WHERE ccK_store_item_users.city = ?

but I don't get how to put the WHEREclause to get the filed city set in the form and how to put the results in a textarea field

If you have some time, do you mind help me a little more and be more specific?

@ricco : Infact I make the city the "main key" to decide how to send the requests from the client so it's for sure mandatory. My problem, in fact, is how to create that query.

thank you

9 years ago
0
Level 1

This is a good question. I will search for this answer.

310 Posts
ricco
9 years ago
0
Level 1

Hi,

So, what you want is your users to be able to send emails to specific group of users.

I think, you need to distinguish the users from the beginning and then create a query which looks up only for that distinguished group.

E.G.: Make the city mandatory on registration.

Regards,

ricco

310 Posts
ricco
9 years ago
1
Level 1

I don't think you are in the right direction. Imagine a list of 1000s of users from the same city. How will your server manage to send all this emails?

I've not seen yet such feature. Sorry.

9 years ago
0
Level 2

Hi ricco, I see what you mean, but the system will be used from a specific category of users, so I predict that the amount of users per city will be contained.

thank you anyway for your suggestions.

 

9 years ago
2
Level 1

hi anyone can help me?

please, I really need to find a solution. 

I still trying to understand how to make the core42 field works how Ilya suggested, but I can not do it alone... 

9 years ago
1
Level 2

Hi kief. 

Sorry for delay..

Core42 field has three textarea for queries. You need Before Store section and you can type php code directly to this textarea. Your query will be applied before data stories. 

So I see follwing algorithm:

  1. You have an Email filed to send email, select field for city choosing, Core42 field to select emails and  fill Email field by these emails and other field which you need.
  2. User fills a city field and other neccessary fields and submits mail form
  3. Before story Core42 field applies a code which select all emails of site users from selected cityand fill Email field by these emails. You can take selected city as $_POST['cityfield_name'] and Email filed as $_POST['emailfield_name'] -all your filed values are in $_POST array.
  4. Form values save and Email filed sends emails to your users.

Bingo!!!

I hope this list will work in reality :)

1283 Posts
Bucklash
9 years ago
0
Level 3

Hi Kief

How are you getting on with this. What have you tried so far?

I am trying to replicate the your example... getting there.

I have the city selected, I am hoping to list the users and have it so that the client can choose to include/exclude some as required..

Bucklash

9 years ago
6
Level 1

@Ilya/@Bucklash: the algorithm aswers exacly my needs, bu I still can find the code to put in the code42 field to select the email from the DB and to put them in the emails field. I' still going triugh the documentation and video that I've found also on youtube, but they didn't help till now...

I know I'm asking a lot...but... can anyone put down some code for me.

thanks

9 years ago
3
Level 2

from your example:

SELECT email FROM users a JOIN cck_store_item_users b ON a.id =b.id WHERE b.city = $_POST['your_city_field_from_form'];

1283 Posts
Bucklash
9 years ago
2
Level 3

Hi Ilya

Have you got any top tips for using. code42? ie:

Do you you use it exclusively for certain things like code42 instead of beforRender etc.  

I haven't found it tet but I seem to remember reading something that suggested code42 shouldn't be user for certain things as it effected search result capability etc... (though that could have been a really pointless dream..... )

Bucklash

9 years ago
1
Level 4

Hi Bucklash

I try to use free fields and Core42 is very useful for different things, but it hasn't After Store section for example, and I can't use it for this. So, in my opinion it's developer's field - it's more than simple construction - you should be coder to use it.

@kief - you won't create any sites without simplest PHP and MySQL skills, sorry..

1283 Posts
Bucklash
9 years ago
0
Level 5

Hi Ilya

Thanks for that, I'm more confident these days with coding so will look at core 42. 

PS

Thanks for your code example!!

1283 Posts
Bucklash
9 years ago
1
Level 2

Hi Kief

I have created and attached an app that does this:

Submission User form, in this form the User selects a City* (I used the table #__cck_more_countries for this app)

Submission Client form, in this form the Client selects a City (only cities that have been selected by a User show).

User Email addresses get retrieved only from the users that submitted the chosen City. 

The email addresses are added to a field as a comma separated list.

The Client selects whether to send an email. If yes, then the email is sent to all the email addresses from the above list of emails.

You will need to create two menu items: Sebled  -> Form: Submission User and, Seblod -> Form: Submission Client. 

You will need to create your own List & Search Types 

You will need to change create your list of Cities and replace the Countries List

       

Check it out, see what you think.

It might be overkill, be good to get your thoughts. Just load it as you would any extension....

       

Bucklash

PS any questions about it, ask!

PPS Any one is welcome to load and try it, be cool to get feedback and suggestions, thumbs up and/or thumbs down

Application package temporarily removed by admin due to breach of Terms and Conditions: distributing a paid SEBLOD plugin within a free app package.

572 Posts
_jrmo
9 years ago
0
Level 3

Hi Bucklash,

Thanks so much for this application! However, I've had to temporarily remove it as you included the Select Dynamic Cascade field within your package, which is a premium product for sale on SEBLOD.com. Distributing paid plugins in that way is a breach of our Terms and Conditions (although I'm sure you didn't do this knowingly).

Can I ask that you please remove this field from your package before sharing it again? Otherwise, please contact us about getting your own vendor store established on SEBLOD.com where we can work out an arrangement for the distribution of this plugin within your app package.

Thanks for your understanding,

James 

9 years ago
2
Level 1

@Ilya: thanks for the code and for the help, I will try it in the next days

@Bucklash: unfortunately I couldn't get the app. Hope to have the possibility to see it soon because from your description it seems that it will help me a lot also to better understand how seblod works.

@_jirmo: just to know, if I buy the "Select Dynamic Cascade" field could you send me also the Bucklash app (obviously only if Bucklash agree with this)?

572 Posts
_jrmo
9 years ago
1
Level 2

Hi Kief,

Yes, we can arrange that. Please comment back here when you've made your purchase.

Cheers,

James

9 years ago
0
Level 3

ok James, done. I will wait for that.

thank you 

1283 Posts
Bucklash
9 years ago
4
Level 1

Hi Sebloders

Yeah, sorry James, didn't think about that. 

Kief, if you think you will stick with Seblod, I reccommend you get the Annual subscription as you get all the goodies. You WILL be wanting more than the Select Dynamic Cascade. 

Bucklash

9 years ago
3
Level 2

Hi Bucklash,

I'm studying your App and I cannot figure it out how did you manage to put the emails you selected with the Select Dynamic Cascade into the 'Users Email Address' field and how did you have them separated by comma.

Do you mind let me know

Thank you

EDIT:

ok I've found the JS script...sorry

1283 Posts
Bucklash
9 years ago
2
Level 3

Hi Kief:

All making sense?

9 years ago
1
Level 4

Hi Bucklash,

thanks to your app, yesterday I've finally manage to solve my question, I've just changed the query to make them easier (at least for me ;) ).

So I've really appreciate your help.

Now I bump my head on other new bigger problem.

I'll need that in the mail there should be a link (that expires in 48h) to a new form that should contains, in the first part, the client's requests and in the lower part a form that can be filled in with the answer and a botton to save them in the system. After the 48h the answers provided from the different users should be automatically compared and only the one with the better price should be sent to the client.

I don't expect to have the solution like you did before but if you have any ideas if this can be done it will already be a big help.

Thanks

1283 Posts
Bucklash
9 years ago
0
Level 5

Hi Kief

Answering these kind of posts help me learn (Ilya's answer was insightful for me), but I'm not sure how to solve this one, sorry.

Getting data evaluated after a set period of time ... would that be some kind of CRON job?

ADDITIONAL COMMENT:

I reckon you can have the client submit the client form, have a new cintent type created dynamically with the publish date 48hrs from now. When it publishes, have the relevant data pulled from the user forms, do the evaluation and submit.

I won't have time to do anything as am too busy at minute, but would like to see someones proposal....

Bucklash

Get a Book for SEBLOD