Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » UserDefined Forms

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 904 Views
  • Hibari
    Avatar
    Community Member
    9 Posts

    UserDefined Forms Link to this post

    Hi, I was wondering if anybody knew a possible solution for a type of field I want to use on the userdefinedform module.

    What I'm trying to do is create a drop-down list of names of the coworkers and when a user clicks one of their names it will then send the email to the corresponding email of the user.

    So, just as an example:

    Andy
    Fred
    Cindy
    Mark

    if somebody clicked the name Cindy from the dropdown list, they could then fill out the text field and upon clicking send, the email would shoot to the email specified for Cindy.
    If this is possible, it'd be a huge help.

  • KS
    Avatar
    Community Member
    10 Posts

    Re: UserDefined Forms Link to this post

    If you are refering to using the User Forms Module http://silverstripe.org/user-forms-module/
    Then you just need to add a dropdown field, then click show options to the right of the box. Click Add Option as many times as you need it and fill in the words in each box supplied.

    That's it.

    Hope that helps,
    KS

  • Hibari
    Avatar
    Community Member
    9 Posts

    Re: UserDefined Forms Link to this post

    Hey KS, thanks for the quick reply.
    Actually, what I was wondering about is how to get that to send an email to them though. Because, you can do a drop-down list. And then you could put their email addresses as the clickable choice. But, the company wants it so that rather than showing the email, it would just show their name, and that name would still send an email to their specified email. If I could, I'd love to do a comment code to make it unseen but still send the email to that email, but you can't even put code into the area to place names.

    So, with that, here's my issue.

    The one solution I thought would be to use the memberlist drop down, but you can't make that be the item to send to in the recepient list. So, that became another problem.

    If you have an answer, that would be a huge help. Thanks so much for the first reply too!

    -Hibari

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: UserDefined Forms Link to this post

    Hi Hibari,

    Currently like you said, you can put the email as the dropdown text and have it email the value in the drop down (The email recipient can be any value in a email field, option field or dropdown field) but no you cannot set a 'value' and a 'title' easily. It's been a feature that has been thrown around so I might have a go at supporting a 'Value' and a 'Title' options for dropdown fields but that would be a bit off.

    I haven't tried the memberlist field for a while, you could edit the userdefinedform_emailrecipient class so that it looks for values in a member list field, that would be a good enhancement. Start by looking how it works roughly line 824-850 (http://open.silverstripe.org/browser/modules/userforms/trunk/code/UserDefinedForm.php). It would need another query to check for member list fields rather than multipleoptionfield and a bit of code to convert the ID to an email.

  • Carrie_Lang
    Avatar
    Community Member
    24 Posts

    Re: UserDefined Forms Link to this post

    Is this question still something not doable with Userforms or is there a newer topic somewhere with the solution? I'm wondering a contact form with dropdown field where user chooses what's the subject of the contact and the email is send to the person who deals with that subject.

    904 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.