Hello Biljana,
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Biba
> Sent: donderdag 18 september 2008 13:13
> To: 'Hippo CMS development public mailinglist'; Hippo Helpdesk
> Subject: [HippoCMS-dev] (no subject)
>
> Hello all,
>
> I am really having troubles while trying to send email alert
> to my site users and I am kindly asking for your help.
>
> My form for visitor subscription contains only field for
> email. No groups, no interests what so ever.
> But, as I see in the hca-core code, I need several tables to
> have information in order to collect subscribers for sending mails.
> How can I perform the simplest mail sending?
> Are there any steps for initializing database?
>
> When I look at the logs I noticed message:
>
> No enabled notifier subscribers found for notifier id: 6 and
> frequency 1
>
> Could somebody tell me what tables should be filled, so I can
> insert data through my code?
You need at least 1 Interest and 1 InterestCategory to get successfully
send e-Alerts. If no Interests are present, no snippets are linked to
subscribers and thus no mails are sent.
Here is an example in Flowscript (Cocoon) how to subscribe a user to all
interests and all e-Alerts (used for testing):
function subscribeToAllNotifications(){
var subscriberId = cocoon.request.getParameter("subscriberId");
var profileService = getFacade("profileService");
var interestService = getFacade("interestService");
var notifierService = getFacade("notifierService");
var subscriber =
profileService.getSubscriber(Packages.java.lang.Integer.parseInt(subscri
berId))
var user = subscriber.getUser();
// get all interests of all notifiers
var interests = interestService.listAllInterests();
var interestIds = new Packages.java.util.ArrayList();
var it = interests.iterator();
while(it.hasNext()){
interestIds.add(it.next().getId());
}
// sets an ArrayList with all Interests for this user
interestService.updateUserInterests(user, interestIds);
// get all notifiers
var notifiers = notifierService.listNotifiers(0,1000);
var notifierIt = notifiers.iterator();
while(notifierIt.hasNext()){
var notifier = notifierIt.next();
var notifierSubscription = new
Packages.nl.hippo.hca.notifier.model.impl.NotifierSubscriptionImpl(subsc
riber,notifier);
// setFrequencyType(1) == immediately
notifierSubscription.setFrequencyType(1);
notifierSubscription.setNotifierEnabled(true);
subscriber.addNotifierSubscription(notifierSubscription);
}
profileService.saveSubscriber(subscriber);
cocoon.sendStatus(201);
}
> Another thing happens. When I make new notifier through CMS,
> I put only text in templates (no freemarker calls yet). But,
> there is an exception in my
> logs:
<snip />
Can you post your templates? I don't have problems creating templates
without Freemarker calls.
Regards,
Jasha Joachimsthal
[EMAIL PROTECTED] - [EMAIL PROTECTED]
www.onehippo.com
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
94952-3329 +1 (707) 773-4646
********************************************
Hippocms-dev: Hippo CMS development public mailinglist
Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html