Advertisement

Plugin to notify users of new articles

For Joomla! 5.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 8:37 am

Hi,

I need to write a plugin that will send an email to users to notify them of new published articles. And while I'm a C++ developer since almost 30 years, I am not experienced with PHP.

This is what the plugin needs to do:
  1. On installation, create a custom user field "Notify me of new articles". Should be a checkbox.
  2. When a new article is published, send an email to all users that have enabled "Notify me of new articles" in their profile.
Since I am also new to Joomla plugin development, I asked ChatGPT 4-o to get me started with code. But, not much to my surprise, the code it gave me does not work at all. The plugin installs without errors, and can be enabled, but it never does anything.

The manifest file

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" group="system" version="5.0" method="upgrade">
    <name>PLG_SYSTEM_NOTIFYNEWCONTENT</name>
    <author>me</author>
    <creationDate>2024-06-06</creationDate>
    <copyright>(C) 2024 me</copyright>
    <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
    <version>1.0.2</version>
    <description>PLG_SYSTEM_NOTIFYNEWCONTENT_DESC</description>
    <files>
        <filename plugin="notifynewcontent">plg_system_notifynewcontent.php</filename>
        <filename>install_script.php</filename>
    </files>
    <languages>
        <language tag="en-GB">language/en-GB/en-GB.plg_system_notifynewcontent.ini</language>
        <language tag="en-GB">language/en-GB/en-GB.plg_system_notifynewcontent.sys.ini</language>
        <language tag="de-DE">language/de-DE/de-DE.plg_system_notifynewcontent.ini</language>
        <language tag="de-DE">language/de-DE/de-DE.plg_system_notifynewcontent.sys.ini</language>
    </languages>
    <install>
        <scriptfile>install_script.php</scriptfile>
    </install>
</extension>
The install script
This should also create the user field "Notify me of new content" in the database. However, it does not. The plugin file is correctly copied to /plugins/system/notifynewcontent, though.

Code: Select all

<?php
// No direct access
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Installer\InstallerScript;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;

class PlgSystemNotifynewcontentInstallerScript extends InstallerScript
{
    public function preflight($type, $parent)
    {
        echo 'Install Preflight';
        Log::add('Preflight action - Type: ' . $type, Log::NOTICE, 'install');
    }

    public function postflight($type, $parent)
    {
        echo 'Install Postflight';
        Log::add('Postflight action - Type: ' . $type, Log::NOTICE, 'install');
        if ($type == 'install') {
            $this->addProfileField();
        } elseif ($type == 'update') {
            // Actions to perform after update
        } elseif ($type == 'uninstall') {
            $this->removeProfileField();
        }
    }

    public function uninstall($parent)
    {
        echo 'uninstall()';
        Log::add('Uninstall action', Log::NOTICE, 'install');
        $this->removeProfileField();
    }

    protected function addProfileField()
    {
        echo 'addProfileField()';
        Log::add('Adding profile field', Log::ERROR, 'install');
        $db = Factory::getDbo();
        $fieldTitle = Text::_('PLG_SYSTEM_NOTIFYNEWCONTENT_NOTIFY');

        // Check if the field already exists
        $query = $db->getQuery(true)
            ->select('COUNT(*)')
            ->from($db->quoteName('#_fields'))
            ->where($db->quoteName('name') . ' = ' . $db->quote('notify_on_new_content'));
        $db->setQuery($query);

        if (!$db->loadResult())
        {
            Log::add('Field does not exist, creating new field', Log::NOTICE, 'install');
            // Add the field
            $query = $db->getQuery(true)
                ->insert($db->quoteName('#_fields'))
                ->columns(array(
                    $db->quoteName('title'),
                    $db->quoteName('name'),
                    $db->quoteName('label'),
                    $db->quoteName('type'),
                    $db->quoteName('context'),
                    $db->quoteName('state'),
                    $db->quoteName('fieldparams'),
                    $db->quoteName('created_time'),
                    $db->quoteName('created_user_id')
                ))
                ->values(
                    $db->quote($fieldTitle) . ', ' .
                    $db->quote('notify_on_new_content') . ', ' .
                    $db->quote($fieldTitle) . ', ' .
                    $db->quote('radio') . ', ' .
                    $db->quote('com_users.user') . ', ' .
                    1 . ', ' .
                    $db->quote(json_encode(array(
                        'default' => '0',
                        'options' => array(
                            array('value' => '1', 'text' => 'Yes'),
                            array('value' => '0', 'text' => 'No')
                        )
                    ))) . ', ' .
                    $db->quote(Factory::getDate()->toSql()) . ', ' .
                    $db->quote(Factory::getUser()->id)
                );

            $db->setQuery($query);
            try {
                $db->execute();
                Log::add('Field created successfully', Log::NOTICE, 'install');
            } catch (Exception $e) {
                Log::add('Error creating field: ' . $e->getMessage(), Log::ERROR, 'install');
            }
        } else {
            Log::add('Field already exists', Log::NOTICE, 'install');
        }
    }

    protected function removeProfileField()
    {
        echo 'removeProfileField()';
        Log::add('Removing profile field', Log::NOTICE, 'install');
        $db = Factory::getDbo();
        $query = $db->getQuery(true)
            ->delete($db->quoteName('#_fields'))
            ->where($db->quoteName('name') . ' = ' . $db->quote('notify_on_new_content'));

        $db->setQuery($query);
        try {
            $db->execute();
            Log::add('Field removed successfully', Log::NOTICE, 'install');
        } catch (Exception $e) {
            Log::add('Error removing field: ' . $e->getMessage(), Log::ERROR, 'install');
        }
    }
}
The main plugin file
This should catch onContentAfterSave(), get a list of users that have the option "Notify me of new content" enabled, and then send the mail.

Code: Select all

<?php
// No direct access
defined('_JEXEC') or die;

use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Router\Route;

class PlgSystemNotifynewcontent extends CMSPlugin
{
    protected $app;
    protected $db;

    public function __construct(&$subject, $config)
    {
        parent::__construct($subject, $config);
        $this->db = Factory::getDbo();
    }

    public function onContentAfterSave($context, $article, $isNew)
    {
        error_log('onContentAfterSave triggered');

        if ($context == 'com_content.article' && $isNew)
        {
            error_log('New article detected');
            $this->notifyUsers($article);
        }
    }

    protected function notifyUsers($article)
    {
        // Get the field ID for 'notify_on_new_content'
        $query = $this->db->getQuery(true)
            ->select($this->db->quoteName('id'))
            ->from($this->db->quoteName('#_fields'))
            ->where($this->db->quoteName('name') . ' = ' . $this->db->quote('notify_on_new_content'));
        $this->db->setQuery($query);
        $fieldId = $this->db->loadResult();

        if (!$fieldId)
        {
            error_log('Field "notify_on_new_content" not found.');
            return;
        }

        // Get all users with the "Notify on new content" enabled
        $query = $this->db->getQuery(true)
            ->select($this->db->quoteName(array('u.email', 'u.name')))
            ->from($this->db->quoteName('#_users', 'u'))
            ->join('INNER', $this->db->quoteName('#_fields_values', 'fv') . ' ON ' . $this->db->quoteName('u.id') . ' = ' . $this->db->quoteName('fv.item_id'))
            ->where($this->db->quoteName('fv.field_id') . ' = ' . (int) $fieldId)
            ->where($this->db->quoteName('fv.value') . ' = ' . $this->db->quote('1'));

        $this->db->setQuery($query);
        $users = $this->db->loadObjectList();

        error_log('Users to notify: ' . count($users));

        // Get the category name
        $categoryId = $article->catid;
        $categoryQuery = $this->db->getQuery(true)
            ->select($this->db->quoteName('title'))
            ->from($this->db->quoteName('#_categories'))
            ->where($this->db->quoteName('id') . ' = ' . (int) $categoryId);
        $this->db->setQuery($categoryQuery);
        $categoryName = $this->db->loadResult();

        // Prepare email subject and body
        $subject = Text::_('PLG_SYSTEM_NOTIFYNEWCONTENT_EMAIL_SUBJECT');
        $bodyTemplate = Text::_('PLG_SYSTEM_NOTIFYNEWCONTENT_EMAIL_BODY');

        // Generate SEF URL
        $articleLink = Route::_(
            'index.php?option=com_content&view=article&id=' . $article->id . ':' . $article->alias . '&catid=' . $article->catid . '&Itemid=' . $article->params->get('item_id')
        , false);

        // Format the publish date
        $publishDate = (new \Joomla\CMS\Date\Date($article->publish_up))->format('d.m.Y');

        $body = str_replace(
            array('{ARTICLE_TITLE}', '{ARTICLE_CATEGORY}', '{ARTICLE_PUBLISH_DATE}', '{ARTICLE_LINK}'),
            array($article->title, $categoryName, $publishDate, Uri::root() . $articleLink),
            $bodyTemplate
        );

        error_log('Email body: ' . $body);

        // Send email to each user
        foreach ($users as $user)
        {
            $mail = Factory::getMailer();
            $mail->addRecipient($user->email);
            $mail->setSubject($subject);
            $mail->setBody($body);
            $mail->Send();

            error_log('Email sent to: ' . $user->email);
        }
    }
}
As you can see, I have put in quite a lot of echo, log, and error_log calls. However, none of these messages ever appears in any of the log files or in the page source. In my Joomla configuration, I have enabled debugging.

I am stumped, because nothing seems to do anything. I guess (there doesn't seem to be much more than guessing with PHP) none of the plugin code is ever executed.

I would appreciate some help, and thank you in advance!

Cheers,
Frank

Advertisement
frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 8:47 am

Here's the complete plugin:
You do not have the required permissions to view the files attached to this post.

SharkyKZ
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3004
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Plugin to notify users of new articles

Post by SharkyKZ » Thu Jun 06, 2024 8:50 am

<scriptfile> should be a direct child of <extension>. Plugin file should be named after the plugin element (notifynewcontent.php), if using old J3 style code.

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 8:54 am

Ah, that's a start, thanks!

You mean like this?
You do not have the required permissions to view the files attached to this post.

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 8:57 am

Ah, that is much better already. At least it's trying to execute my code.

I get an error though:
Table 'd0403e04.#_fields' doesn't exist.

So, does that mean that I can't use "#" for table names (like in my case "#_fields")?

Code: Select all

$query = $db->getQuery(true)
            ->select('COUNT(*)')
            ->from($db->quoteName('#_fields'))
            ->where($db->quoteName('name') . ' = ' . $db->quote('notify_on_new_content'));

SharkyKZ
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3004
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Plugin to notify users of new articles

Post by SharkyKZ » Thu Jun 06, 2024 8:59 am

Prefix placeholder is "#__", so it should be #__fields (two underscores), not #_fields.

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 9:00 am

Oh right, thanks. Trying it out now...

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 9:02 am

Getting there :-)

Installation now finishes without errors. And I do get these messages:
Bildschirmfoto 2024-06-06 um 11.01.34.png
So, obviously, the functions in my install script are called now.

Why does the text on top only say "PLG_SYSTEM_NOTIFYNEWCONTENT_DESC", instead of showing the actual string?
You do not have the required permissions to view the files attached to this post.

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 9:04 am

Also, the plugin appears in the extensions list as "PLG_SYSTEM_NOTIFYNEWCONTENT", and does not use the actual title defined in the .ini file. When my install script still wasn't executed, the strings worked correctly. :eek:

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 9:19 am

It also still does not create the custom user field. The log says:

Code: Select all

2024-06-06T09:17:40+00:00	ERROR 79.244.54.24	install	Error creating field: Field 'description' doesn't have a default value

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 9:28 am

After adding "description" to the install script, and filling in some dummy text, I got the same error for "params" on the next installation. After dreaming up some dummy JSON for that, too, I now get the error for "modified_time".

So, do I really have to provide some default data for every field in the database table? Or is there a more comfortable way of doing this?

I also noticed that, when uninstalling the plugin, the log says "Field removed successfully", but the field is not removed.

After creating the field manually on the administrator page, the plugin still does nothing when posting a new article. Nothing appears in the log file, either. So I guess, the code in the main plugin file is also never executed?

So, the remaining questions are:
  • How do I get the field created on installation?
  • How do I get the main plugin file to do anything?
Thanks a lot in advance!

Cheers,
Frank
Last edited by frankw80 on Thu Jun 06, 2024 10:15 am, edited 1 time in total.

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 10:08 am

frankw80 wrote: Thu Jun 06, 2024 9:04 am Also, the plugin appears in the extensions list as "PLG_SYSTEM_NOTIFYNEWCONTENT", and does not use the actual title defined in the .ini file. When my install script still wasn't executed, the strings worked correctly. :eek:
OK, it seems the string files have to be named like "de-DE.plg_system_notifynewcontent.ini" instead of "de-DE.notifynewcontent.ini". Strings working again.

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 10:30 am

Here is the latest code. If anyone finds the time to have a look and maybe tell me why none of the code in the main plugin file is executed, I'd be chuffed :-)

plg_system_notifynewcontent.zip

And yes, I know this looks like I don't want to do the work myself. But so far, I have spent around 4 hours on tiny plugin. I can't find what I'm looking for in the Joomla API documentation, and mostly I don't even know what I should be looking for.

I can even live with having to create the custom field myself. But I have absolutely no clue why the main plugin file does not do anything.

Thanks & cheers,
Frank
You do not have the required permissions to view the files attached to this post.

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 11:26 am

I got the install script working now. It creates the field on installation, and successfully removes it on uninstall. Yay!

Turns out, I always named the field "notify_on_new_content", but when I looked into the database, it was called "notify-on-new-content". For some reason, the underscores were changed to hyphens. Now I'm using hyphens throughout.

So now, the last open question is how to actually notify the users when a new article is published. So far, it doesn't do anything. It doesn't even write anything into the log file.

Do I have to somehow register the plugin in the system, so it gets called?

Cheers,
Frank

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 1:41 pm

Yay, I did it, it works!

Thanks for the initial help. Here's the code:

plg_system_notifynewcontent.zip

Cheers,
Frank
You do not have the required permissions to view the files attached to this post.

gsmela
Joomla! Explorer
Joomla! Explorer
Posts: 324
Joined: Thu Jun 10, 2010 12:38 pm
Contact:

Re: Plugin to notify users of new articles

Post by gsmela » Thu Jun 06, 2024 2:14 pm

I really don’t mean this to be snarky - really - but isn’t this just reinventing RSS?

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 2:16 pm

I don't know anybody who still uses an RSS reader, but plenty of people with a mail account.
Also, the website I'm doing this for is used mostly by old people, I don't want to scare them with cutting edge technology like RSS :laugh:

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 8:41 pm

There is an issue, though. Maybe someone has an idea...

The plugin works well, if I create the new article from within the administrator page. But I also have menu links on the website that allow creating an article in the frontend (index.php?option=com_content&view=form&layout=edit). And if I create an article in the frontend, the onContentAfterSave() function is not called.

How can I execute the plugin when an article is created in the frontend?

Thanks in advance & cheers,
Frank

SharkyKZ
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3004
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Plugin to notify users of new articles

Post by SharkyKZ » Thu Jun 06, 2024 9:22 pm

Context in frontend is "com_content.form". You need to check for both "com_content.article" and "com_content.form".

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 9:31 pm

Fantastic, thank you so much!
Working like a charm :-)

Cheers,
Frank

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Thu Jun 06, 2024 10:05 pm

I pimped the plugin a little, and now we can set the category to monitor and compose the mail subject and body in the plugin configuration. No need to modify the source files anymore.

Also checked it into Github. If anyone's interested:
https://github.com/fwilleke80/plg_syste ... newcontent

Thanks again for the help!

Cheers,
Frank

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Sun Jun 09, 2024 9:59 am

How difficult or easy would it be to add an option to the „Create article“ form that would allow me to sent or not send the mail when I create a new article? That would offer better control than just monitoring a category.

Now that I got the basic plugin working, I’d like to improve it :)

Cheers,
Frank

User avatar
pmleconte
Joomla! Guru
Joomla! Guru
Posts: 606
Joined: Fri Mar 17, 2017 12:55 pm
Location: France

Re: Plugin to notify users of new articles

Post by pmleconte » Mon Jun 10, 2024 1:59 pm

Hi Frank,

I just released a package doing what you are working on : AutoMsg : https://github.com/conseilgouz/pkg_automsg_j4

It's a component because it's a bit more complex : like your plugin, it sends email onContentAfterSave or onContentChangeState, and :
- it allows asynchronous mailings (send multiple articles once a day/a week/...),
- it handles partial mailing : if your hoster limits the number of mails you can send in one hour for example, mailing process stops and a scheduled task sends the remaining mails in one or more runs.

It uses scheduled tasks, email templates.

In user profile, a field has been added to allow/disallow receiving those emails.

Hope this helps,

Pascal
If anything can go wrong, it will.
https://www.conseilgouz.com/en

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Mon Jun 10, 2024 2:01 pm

Hi Pascal,

that sounds nice, too, I'll take a look at it. Anything that saves me from having to write code even in my free time is welcome :-)

Cheers,
Frank

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Mon Jun 10, 2024 6:10 pm

pmleconte wrote: Mon Jun 10, 2024 1:59 pmI just released a package doing what you are working on : AutoMsg : https://github.com/conseilgouz/pkg_automsg_j4
I installed it, and though it said the installation was successful, it also threw an error about the "Email config".

The component is there, as well as the plugins (Content, Task, Profile) and the mail templates. The field in the user profile is also there, and it's enabled. But I do not get an email when publishing a new article. When I deleted my test messages, I did get an AutoMsg mail about an article not being available anymore, though, so sending mails in general seems to work. When uninstalling the AutoMsg extensions, I get a warning "Joomla\Filesystem\File::delete: Failed deleting inaccessible file services". Any ideas?

Cheers,
Frank

P.S.: After enabling system debugging and logging, I found this in the everything.php log file:

Code: Select all

2024-06-10T18:08:39+00:00	ERROR 80.132.237.200	mail	Error in Mail API: Sending with mail()
2024-06-10T18:08:39+00:00	ERROR 80.132.237.200	mail	Error in Mail API: Sendmail path: /usr/sbin/sendmail -t -i
2024-06-10T18:08:39+00:00	ERROR 80.132.237.200	mail	Error in Mail API: Envelope sender: 
2024-06-10T18:08:39+00:00	ERROR 80.132.237.200	mail	Error in Mail API: To: My Name <[email protected]>
2024-06-10T18:08:39+00:00	ERROR 80.132.237.200	mail	Error in Mail API: Subject: My Website : AutoMsg report.
2024-06-10T18:08:39+00:00	ERROR 80.132.237.200	mail	Error in Mail API: Headers: Date: Mon, 10 Jun 2024 20:08:39 +0200
From: "mywebsite.de" <[email protected]>
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8


2024-06-10T18:08:39+00:00	ERROR 80.132.237.200	mail	Error in Mail API: Result: true
2

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9975
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Plugin to notify users of new articles

Post by AMurray » Fri Jun 21, 2024 10:23 pm

I don't know if you resolved your issue, but I was just reviewing the JED and came across this https://extensions.joomla.org/extension ... s/automsg/ under "new extensions" (only released 21 June) - does exactly what you want: notifies users when new articles are published.
(you wanted to develop your own, but this response may help others, reading this thread).
Regards - A Murray
General Support Moderator

frankw80
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Jun 06, 2024 8:22 am

Re: Plugin to notify users of new articles

Post by frankw80 » Fri Jun 21, 2024 11:16 pm

Yeah, I tried that, but couldn’t get it to actually send the mails. For what I need (small site, only few users), my plugin works well.

Cheers,
Frank

Advertisement

Post Reply

Return to “Joomla! 5.x Coding”