We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42
    • 5 Posts
    I’ve been using the Easy Newsletter Module for a few months now without any problems.

    I’m wondering though if there is a way to add in a notification when a new person subscribes.


      • 21419
      • 84 Posts
      I’d like to know that too. Would be very useful. Anybody have any ideas?
        • 21419
        • 84 Posts
        I think I just figured out how to do this... It’s pretty simple, really. Would love a MODx genius to take a look at it to see if there is a better way or check for security issues.

        In the snippet code for Easy Newsletter, I inserted the following code between line 39 and 40:

        LINE 39. if ($num < 1) {
        		//EMAIL CODE BEGIN
        		require_once('manager/includes/controls/class.phpmailer.php');
        		$mail = new PHPMailer();
        		$mail->IsSMTP();
        		$mail->IsHTML(false);
        		$mail->From = $from;
        		$mail->FromName = $from_name;
        		$mail->Subject = $subject;
        		$mail->Body = $message;
        		$mail->AddAddress($to);
        		$mail->send();
        		//EMAIL CODE END
        LINE 40  $sql = "INSERT INTO...
        


        In my situation, I have to use SMTP mail, which I configured in /manager/includes/controls/class.phpmailer.php.

        It works though. Give it a try.