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.

Data Model Questions /

Mailing List for Public and Members


Reply


3 Posts   1301 Views

Avatar
dizzystuff

Community Member, 93 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 [url=http://silverstripe.org/data-model-questions/show/15760]this Member stuff[/url] all day! Any help or guidance would really be appreciated :)

Avatar
Willr

Forum Moderator, 5513 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, 93 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