Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Newsletter Trouble

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1269 Views
  • dio5
    Avatar
    Community Member
    501 Posts

    Newsletter Trouble Link to this post

    Could be I overlooked something in the documentation, but I'm having trouble sending Newsletters.

    Currently, I don't use the newsletter-signup form but have visitors auto-signedup when registered on the site.

    The code I'm currently using for that is:

    $newsRecipient = Object::create('Newsletter_Recipient');
    $newsletter = DataObject::get_one("NewsletterType", "Title = 'Nieuws van Photoplaces'");
    $newsRecipient->MemberID = $currentMemberID;
    $newsRecipient->write();
    $member->Groups()->add( $newsletter->GroupID );

    $member is the $member that has just registered. So I have my members in 2 groups namely a frontend-user group and the group of the mailinglist.

    This seems to work and I can see the member also as a member of the newsletter type in the cms.

    The first question I have is: do I have to create a Newsletter_Recipient? Or isn't this necessary?

    Secondly, I can't seem to send a newsletter. They don't arrive. (They are marked sent in the newsletter section though) Maybe this is because I have this Newsletter_Recipient created earlier?

    And thirdly: when I want to add Members to the list manually, I get an error:

    Warning: No form () returned by NewsletterAdmin->EditForm
    At line 150 in /MYSITEROOT/sapphire/core/control/Controller.php

    user_error(No form () returned by NewsletterAdmin->EditForm,512) line 150 of Controller.php Controller->run(Array) line 53 of Director.php Director::direct(admin/newsletter) line 101 of main.php

    Error: Object::__call() Method 'callfieldmethod' not found in class 'NewsletterAdmin'
    At line 190 in /MYSITEROOT/sapphire/core/Object.php

    user_error(Object::__call() Method 'callfieldmethod' not found in class 'NewsletterAdmin',256) line 190 of Object.php Object->__call(callfieldmethod,Array) line of NewsletterAdmin->callfieldmethod(Array,) line 165 of Controller.php Controller->run(Array) line 53 of Director.php Director::direct(admin/newsletter) line 101 of main.php

    Fourth question: am I correct that Newsletter templates still have to be in the mysite/templates/email directory in opposition to all the 'normal' email templates that can reside in themes/templates/email?

    Any ideas?

    Thanks!

    mm.. there seems to be an issue with the code-formatting here... but I hope you get the issue.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Newsletter Trouble Link to this post

    Update:

    I figured that doing

    $member->Groups()->add( $newsletter->GroupID );

    is probably enough and that creating this Newsletter_Recipient probably isn't necessary (the regular signup form doesn't seem to do this either)

    When looking at the sent items in the cms, in the 'sent at' row there is 'none'.
    Doesn't the newsletter stuff work when you have only 1 mailinglist member?

    It works when I send a test mail though.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Newsletter Trouble Link to this post

    Oh forget it... it was my mistake again, I messed up somewhere with the Unsubscribe-stuff...

    1269 Views
Page: 1
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.