Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# D3grade 4/5/2007 3:31 PM
Ok,

I have a requirement to create an newsletter subscription module and was just looking for some advise.

I am going to create my own user class that extends the cuyahoga user (as i require additional fields) and will create a module for registering and updating info.

What i really want your help in is desiding where the admin should be for actually sending the emails?

Should this be available in the admin to the newsletter module? or should this just be a section in the admin area that happens to use the newsletter users?

What are you thoughts?

Matt
# swilliam 4/9/2007 5:32 PM
Matt

I'd make the admin within the newsletter module itself to keep things cleaner. In the section edit/admin area you would probably prepare the content of each newsletter. As there is no way of automatically scheduling tasks (Martijn?), you would also need a way to initialise the sending of the newsletter(s), probably within the same area.

Many thanks

Simon
# martijnb 4/10/2007 2:19 AM
I'm with Simon here. Just make a module-specific admin page from where the newsletter content is maintained and sent.

And no, unfortunately we don't have a scheduler.
# Degrade 4/10/2007 2:45 AM (edited 4/10/2007 3:01 AM)
Cheers guys,

Just the help i needed.

I do have on other question (i know i asked something similar before, but i don't think it's the same question).

How would i go about saving a users newsletter preferences? My question is mainly oriented around the use of a module, as in, how would i add the newsletter preferences to a user only when the newsletter module is installed?

In this case, would i be better suited to creating a newsletter preferences class that is linked to a user rather than extending the user?

Matt
# martijnb 4/11/2007 2:13 PM
I'd go for a separate newsletter preferences class.
# D3grade 4/11/2007 3:03 PM
I think i know what i have to do now.

Thanks guys.

PS I'll be sure to post my solution when it's done.
# D3grade 4/12/2007 3:36 PM
Ok, new question :D

I have a newsletter object, which has 2 list properies TestRecipients and LiveRecipients which are both lists of Recipient objects.

My question is how do i map this in nhibernate? What i would like to do is keep the Recipient object generic, so would want to have a "type" field in the match table which says if they are a test recipient or live recipient.

Anyone know how to go about this?

Many thanks

Matt
# Degrade 4/13/2007 2:58 AM
Ok. Having slept on it, my new thought is that there should be 2 match tables, one for test recipients and one for live. Would i be right?
# martijnb 4/13/2007 9:58 AM
This can be done easily with one table, two subclasses that inherit form Recipient (TestRecipient , LiveRecipient) and a discriminator field in the table. NHibernate fully supports this (check docs about inheritance mapping).
# D3grade 4/13/2007 1:38 PM
Ahhhhhh, i knew about the discriminator value for mapping sub classes, but i didn't twig to use sub classes.

Cheers Martijn

PS Sorry if some of my questions are a bit newbie but it's my first time with NHibernate, but i'm lovin it.
# martijnb 4/14/2007 10:45 AM
No problem! Always feels good to help others discovering NHibernate :).
# D3grade 4/27/2007 11:16 AM
Ok,

I have come up against another problem. What i am wanting to do is send my emails in a seperate thread, so as to allow the user to continue using the system whilst emails are being sent, but that thread needs to be able to get a list of Subscribers.

My problem is that because i am using a seperate thread, when i try to execute another method that usees the session manager it is not available in the HttpContext

Does anyone know how to solve this?

Many thanks

Matt
# martijnb 4/27/2007 11:45 AM
Have a look at the RemoteContent module (RemoteContentModule.cs). It updates the feeds in a backgound thread. The trick is to create a separate class that does the backgound work. The class doesn't use the NHibernate Session that is available in the HttpContext but directly requests new Sessions from the SessionFactory.
You can use the same concept to send emails in a separate thread.
# D3grade 4/27/2007 4:16 PM
Perfect,

Cheers Martijn
# ps.ss 11/23/2008 10:13 AM
Anyone knows about newsletter module releases?