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;
$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?
mm.. there seems to be an issue with the code-formatting here... but I hope you get the issue.