Send Email after a comment

Hi,
I would like to send an email when somebody write a comment in the gallery,
I tryed to set the email address in the Admin, but I still don't send emails

What can I do for it?

Comments

  • To whom do you want to send the mail? When do you want it sent?
  • yes you are right, I didn't give you enough info,

    when somebody write a comment to a picture, I'd like that an email is sent with a custom text to the author of the gallery and to the Admin.

    is it possible?

    thanks
  • acrylian Administrator, Developer
    You need to enable the checkbox on options > comment configuration. A custom text is not possible though.
  • the "Enable comment notification" is already enabled and a valid email address is set for the Admin.

    If I use the code below in a page, I receive the email in my email address, so I don't understand why I don't get the one from the comment

    <?php
    $to = "myaddress@ddd.com";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";
    $headers = "From: anotheraddress@ddd.com\r\n" .
    "X-Mailer: php";
    if (mail($to, $subject, $body, $headers)) {
    echo("<p>Message sent!</p>");
    } else {
    echo("<p>Message delivery failed...</p>");
    }
    ?>
  • Well, zenphoto is using `zp_mail($subject, $message, $headers, $to)` to send the messages. Not really the same thing. Maybe you can try this function on your page to see if it works.
  • in which file can I find the zp_mail function? (for import it in my page)
  • It is in functions.php. However, you do not need to import it. It will be available to your page.
  • acrylian Administrator, Developer
    It might be that your server is not configured for php mailing or it is not allowed. Our mail function uses actually the standard php mail() function as a base.
  • OK I made ti to work, thank you!!

    Now, how can I send the email to the owner of the picture or to the person that wrote the previous comment?
  • There is a plugin named filter-comments.php that is part of the 1.2.4 release. You can get a preview of this release by downloading the nightly build.

    You can make modifications to this plugin to do what you wish. At present it will send the mail to everyone who has posted a comment on the image.
  • ok I'll wait the release of the 1.2.4

    thanks
Sign In or Register to comment.