17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1183 Views |
-
Newsletter Trouble

12 November 2007 at 11:36pm Last edited: 12 November 2007 11:48pm
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.phpuser_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.phpuser_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.
-
Re: Newsletter Trouble

13 November 2007 at 12:15am Last edited: 13 November 2007 12:24am
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.
-
Re: Newsletter Trouble

13 November 2007 at 12:44am
Oh forget it... it was my mistake again, I messed up somewhere with the Unsubscribe-stuff...
| 1183 Views | ||
|
Page:
1
|
Go to Top |

