Jump to:

10989 Posts in 2726 Topics by 1817 members

All other Modules

SilverStripe Forums » All other Modules » Emailing Members

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 582 Views
  • oerm4411
    Avatar
    Community Member
    14 Posts

    Emailing Members Link to this post

    I have Willr's UserForms installed on my site. I would like to create a form to allow members to email themselves. I thought that the 'Member Field' would allow users to select the member they wish to contact. Unfortunately, that field doesn't provide an email address for the form to send the message. Would it be possible to create such a form?

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Emailing Members Link to this post

    You could create your own field type for that pretty easily. If you have a look at EditableMemberListField it does pretty much what you want but rather than returning the name from getValueFromData() you would want to return the email address.

    Sending the email is a little tricker, you could adapt the Userform Email Recipient popup to allow you to select an EditableMemberList field as the 'Send To' option.

  • oerm4411
    Avatar
    Community Member
    14 Posts

    Re: Emailing Members Link to this post

    How would I create a field for this? In the list of fields, there is a Member List Field, but no EditableMemberListField.

    Once the field is created, I think I could add it to the "send to" email field on my own.

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Emailing Members Link to this post

    How would I create a field for this? In the list of fields, there is a Member List Field, but no EditableMemberListField.

    The editable member list field is the class name of the field. You can see the class in userforms/code/editor/. The module will automatically pick up any subclasses of 'EditableFormField' and display it in the editor.

    In your cause you could extend the EditableMemberListField class with your own class and override the getValueFromData() method to return the email.

  • oerm4411
    Avatar
    Community Member
    14 Posts

    Re: Emailing Members Link to this post

    Okay, I see the file you are talking about, but the rest of the process is a complete mystery to me. I see a bunch of code in the file, but I don't have a clue on how to change that code for my needs.

    Forgive my ignorance please. Perhaps someone can provide the code I need so I can just cut-and-paste? Or perhaps just creating a new file for me to use? I don't want to be a pain, but I don't want to screw up the utility by modifying the file incorrectly.

    ETA: If possible, I would also like the 'From' field to automatically select the current user who is sending the message.

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Emailing Members Link to this post

    Ah yes, sorry my instructions were designed for more of a developer. If no one responds you may want to post this as a small job to oDesk or similar to commission a developer to get it working to your needs.

    582 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.