GithubHelp home page GithubHelp logo

E-Mail new comments about slicomments HOT 3 OPEN

rgblogs avatar rgblogs commented on July 21, 2024
E-Mail new comments

from slicomments.

Comments (3)

jonnsl avatar jonnsl commented on July 21, 2024

There is no way to do that in the current version but a notification system is planned for the version 1.4

from slicomments.

adamgatt avatar adamgatt commented on July 21, 2024

I would also like an email notification for new comments. Happy to see it is planned in a future release.

In the meantime I've inserted this block of code into com_slicomments/controllers/comments.raw.php on line 47.

/*

Send email notification that a new comment has been posted

*/

$to_address = "[email protected]";
$from_name = "Your Website Name";
$from_address = "[email protected]";

$subject = "Article Comment";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: =?UTF-8?B?". base64_encode($from_name) ."?= <$from_address>\r\n";
$headers .= "Bcc: " . "\r\n" . "X-Mailer: php";

$emailContent = "

A user has posted a new comment on the yourdomain.com Website. This comment is currently pending and will not be published until it is authorised by an Administrator. Please login to the Administration area of the website and approve or delete this comment.

The details of the comment are:
  • User: ";
    $emailContent .= $data['name']; /* Author's name.*/
    $emailContent .= "


This notifcation was auto-generated by the <a href="http://www.yourdomain.com\">yourdomain.com Website - If this was sent to you in error or there are any problems please email <a href="mailto:[email protected]">[email protected].


";

mail($to_address, $subject, $emailContent, $headers, "-f $from_address");

/*

End email notification block.

*/

With my limited PHP and Joomla knowledge I can only figure out how to include the Comment Author's name in the email notification. =( I hope someone finds this useful.

from slicomments.

gquadro avatar gquadro commented on July 21, 2024

A possible plugin implementation for this is in pull request #54

from slicomments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.