Jump to:

3430 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Mailing List for Public and Members

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

Page: 1
Go to End
Author Topic: 1260 Views
  • dizzystuff
    Avatar
    Community Member
    93 Posts

    Mailing List for Public and Members Link to this post

    So I'm putting together a module to maintain n number of mailing lists/subscriptions. I'm not using it to send, I'll be syncing it with a third party app which will handle all sending/etc.

    I'd like to be able to assign Members to mailing lists (many to many) but also have a public facing subscription form that simply asks for email address and maybe name. I'd like to add these to the mailing list too, but I'm really trying to avoid adding them as 'empty' Members - because they're not members, they don't have login rights, etc.

    Is this possible?

    Sorry if this is a really dumb question, my brain is fried after trying to sort out this Member stuff all day! Any help or guidance would really be appreciated

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Mailing List for Public and Members Link to this post

    Are you talking about the newsletter module mailing list?

    If not then just adapt your mailing list to have many members and many subscribers (Subscriber would be a new DataObject). Then when it comes to getting the list you merge the Subscriber records with the member records (if you have both) ($members->merge($this->Subscribers()). You can also be on the safe side and use $members->removeDuplicates('Email'); to ensure only 1 email is sent to each email.

  • dizzystuff
    Avatar
    Community Member
    93 Posts

    Re: Mailing List for Public and Members Link to this post

    Hah! Neat! That's exactly the kind of thing I was after. I knew it would be something pretty simple, I've just had one of those days where I seem to make everything more difficult for myself!

    (I wasn't talking about the newsletter module.)

    Thanks

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