Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Newsletter Module: include subscription form

Discuss all other Modules here.

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

Page: 1 2 3
Go to End
Author Topic: 5739 Views
  • Normann
    Avatar
    Forum Moderator
    12 Posts

    Re: Newsletter Module: include subscription form Link to this post

    Thanks, yurigoul. Yup, the newletter module will be(or has already been?) decoupled from userdefinedform. We just didn't officially announced this due to the new features lack of testing. But that is what we think the right way to go.

    By using the new "SubscriptionPage" you are be able to define a form with all fields available from Member, Member's subclasses, Member's decorators as the form field candidates, each field can be customised with its own label, its own validation message in CMS, etc.

    The reasons to decouple the module from UserDefinedForm are, besides what yurigoul mentioned above, also because if an back-end user defined some fields that doesn't exist in Member (and its subclasses and decorators) in his UserDefinedForm, then he will lost in where these data goes and how to retrieve them.

    In general, all modules for SilverStripe core should be only depended with SilverStripe core, and less related with other modules to keep them neat and work all the time. UserDefinedForm are dying, we just don't want the two modules coupled.

  • Valorinbattle
    Avatar
    Community Member
    95 Posts

    Re: Newsletter Module: include subscription form Link to this post

    Normann, is there a way to add the "Subscribe" field to other pages that aren't subscription page?
    Also, I cannot get the unsubscribe feature to work. When I test it, it does let me submit the email address and select which newsletters to remove me from, but I don't get a confirmation page and it doesn't remove the record in the backend.

    Thanks
    ~ James

  • Normann
    Avatar
    Forum Moderator
    12 Posts

    Re: Newsletter Module: include subscription form Link to this post

    I guess the above discuss has already addressed about add the subscribe form to other pages, basically, it doesn't work well with the new version (2.4), but if you have to use the UserDefinedForm as your subscribe form, you might want to have some code in Page.php like:

    function SubscribleBlurb(){
    $subscribeForm = = DataObject::get_one('SubscribeForm');
    if($subscribeForm && Translatable::is_enabled()){
    $locale = Translatable::get_current_locale();
    $subscribeForm = $subscribeForm->getTranslation($locale);
    }
    if($subscribeForm) {
    $formController = new SubscribeForm_Controller($subscribeForm);
    retrun $formController->Form()->fortemplate();
    // or return $formController->Form()->renderWith('Form', 'your customise form template');
    }
    }

    and in your Page.ss

    $SubscribleBlurb

    have your debug on, insert Debug::show(); to the above code since there might be syntax error there.

    For your unsubscribe stuff, there a long story about this, and it's not working for a long time and need new release which works with 2.3/2.4, which is our effort in the near future. I suggest you go to Unsubscribe.php and find the function unsubscribe(), try to read the code and make your own fixes, debug::show() is still a good way to show what wrong there.

    Good Luck.

  • TF-35Lightning
    Avatar
    Community Member
    137 Posts

    Re: Newsletter Module: include subscription form Link to this post

    hi guys Im trying to extend the subsciption with a little bit of extra functionality. If anyone wants to help with a few simple steps that would be great.

    http://www.silverstripe.org/all-other-modules/show/292918?showPost=292918#post292918&flush=1

  • CHD
    Avatar
    Community Member
    218 Posts

    Re: Newsletter Module: include subscription form Link to this post

    this may come in handy for anybody who wants to easily include forms in a sidebar or any other area of the site, without controlling a hidden page:

    http://www.clickheredigital.co.uk/blog/how-to-include-a-silverstripe-form-on-any-every-page/

    5739 Views
Page: 1 2 3
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.