10446 Posts in 2223 Topics by 1719 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2154 Views |
-
Extending the newsletter module

29 April 2009 at 3:22am
I am working on a website these days, for that I want to extend to Newsletter module mainly the newsletter class. The point is this, I want to add the latest blog posts on the newsletter. Now what I did was that I created a new class which extends the Newsletter. my class looks like this,
<?php
class ExtendedNewsletter extends Newsletter{
function pages(){
return DataObject::get("Page");
}}
?>
And I added this code in my /mysite/_config.php
Object::useCustomClass('Newsletter', 'ExtendedNewsletter');
now the problem is that whenever I create a new draft it creates a Newsletter Object, not a ExtendedNewsletter. Anyone can tell me what is wrong here, and do I need to use a DataObject decorater instead of extending the Newsletter class?
-
Re: Extending the newsletter module

20 August 2009 at 8:36pm
What you're doing should work but it doesn't since they've hardcoded the class names in NewsletterAdmin.php. You basically have to rewrite NewsletterAdmin to call Object::getCustomClass(); to make sure it gets the right classes instead of the class names that have been hard coded in there.
I will probably be making these changes myself but I have already changed some stuff in the module to allow for multiple users without sharing newsletter types and automatic newsletter group generation for each newsletter type.
-
Re: Extending the newsletter module

24 December 2009 at 5:26am
Dear Nivanka,
Did you get this to work, and... could you please post the exact steps towards the solution. I would like to add an image to the email template by adding an ImageField. Many thanks in advance!!!
-
Re: Extending the newsletter module

7 July 2010 at 2:14pm
Did anybody figure out how to extend the Newsletter module until now ? need to extend newletter as well. I need to make the generation of Mailinglists more flexible. For example get all Members as Recipiants which Gender is female.
thanks for help in advance!
-
Re: Extending the newsletter module

14 October 2011 at 10:37am
Me too. Looking to add some fields to the newsletter. By randomly hacking around in the NewsletterAdmin I've managed to get my extended newsletter to appear but I really don't know what I'm doing.
Have tried a number of ways but none very fruitful. It's a bit sad that this module seems to be a little neglected - it could be so useful with some customisability! Anyone got anywhere?
| 2154 Views | ||
|
Page:
1
|
Go to Top |



