sebastiangreger / kirby3-commentions

A versatile comment system and integrated Webmention endpoint for Kirby 3.
MIT License
58 stars 7 forks source link

DOn't know if this is an issue → E-Mail not send #80

Closed admin-teametry closed 4 years ago

admin-teametry commented 4 years ago

Hi,

I'm a newbie to Kirby and the commentions plugin. I testet the example with

'hooks' => [ 'commentions.add:after' => function ($page, $data) { try { kirby()->email([ 'from' => 'admin@...', 'to' => 'andreas@...', 'subject' => 'New comment/webmention on ' . $page->title(), 'body'=> print_r($data, true), ]); } catch (Exception $error) { echo $error; } } ]

in the hooks.php of your plugin and also in the "site/config/config.php" without success. Testing email with a contact form on my site, sending is successful.

Do I have wrong thinking, because I think your example should work out of the box, correct? Or is it in the wrong place?

Thanks and regards Andreas

sebastiangreger commented 4 years ago

The code snippet should be placed in file site/config.php (not site/config/config.php). If you don't have any other options in that file, it should look like this:

<?php
return [
    'hooks' => [
        'commentions.add:after' => function ($page, $data) {
            try {
                kirby()->email([
                    'from' => 'webserver@example.com',
                    'to' => 'admin@example.com',
                    'subject' => 'New comment/webmention on ' . $page->title(),
                    'body'=> print_r($data, true),
                ]);
            } catch (Exception $error) {
                echo $error;
            }
        }
    ],
]
sebastiangreger commented 4 years ago

@admin-teametry Has this issue been resolved?

sebastiangreger commented 4 years ago

No reply in 15 days; assuming not a bug and solved ...happy to reopen when needed.

sebastiangreger commented 1 year ago

@admin-teametry I hope you don't mind me pinging you here in a slightly off-topic manner, but I'd like to draw your attention to my update that I am no longer able to maintain the Commentions plugin in the future → details here.