Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

Mailing List for Public and Members


Go to End


3 Posts   1909 Views

Avatar
dizzystuff

Community Member, 94 Posts

10 February 2011 at 6:32pm

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 :)

Avatar
Willr

Forum Moderator, 5523 Posts

10 February 2011 at 8:25pm

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.

Avatar
dizzystuff

Community Member, 94 Posts

10 February 2011 at 11:09pm

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