Hi everyone,
I created a hook to execute a plugin after a page becomes visible. The plugin send an email with the page information (Like a newsletter).
My problem is that in localhost runs correctly but in my client server when I sort the page, kirby starts to load few minutes and the email doesn’t send. In both cases I’m using SMTPMailer with the same connection info.
This is the code of the hook:
kirby()->hook('panel.page.sort', function($page) {
$templates = array(
'default',
'new',
'course',
'depart-proyectsarticle'
);
$template = $page->template();
if(in_array($template, $templates)){
if($template == 'default'){
$template = $page->parent()->parent()->template();
}
intranetNewsletter($template, $page); <-- this is the plugin
}
});
The error could be the permissions of the files? Or because there are a plenty of pages in content? I don’t know if those things are the problem.