XF 2.1 Send Email for Each New Topic

xSean

Member
Trying to setup a forum to send out emails every time that a new topic is created within it, basically a newsletter forum.
Problem is that while I can get it so that this forum is auto-watched upon registration and so alerts are sent within the forums themselves to the user, it will not send out emails for whenever a new topic is made.

Only way I can get it to send out emails is if that user follows a topic and then an email is sent out for each new reply to that topic.

I only want it to send emails related to that forum upon each new topic creation. I'm not seeing anything that really "fits" on the config.php documentation.
 
I already have an addon that handles that for forums specifically, though issue I'm running into is in regards to how emails are sent out... or really NOT in this case.

So while I can get it to push out a notification within the forums themselves whenever a new topic is created, it does not send out emails for those notifications specifically.
 
Last edited:
Was hoping there was some built-in setting within Xenforo that would automatically send emails for watched forums, and maybe there is... but couldn't find one.


Instead just went back to the addon and looked through its files and made a few manual adjustments.
Those manual adjustments did the trick and now I have a newsletter forum for specific usergroups.
 
What add-on are you using? I'd like to do something like that too.


I set this up using this addon.
This ONLY applies to new members after this addon is installed. Luckily for me that wasn't too much of an issue, but if you already have a sizable community, then there will be quite a few who will not be auto-watching.

By default it only sets the flag for in-forum alerts, not emails, so this has to be manually edited within its files if you would like it to behave like a newsletter. The specific forum(s) you want to set it to is already part of the addon's own customizable settings within the ACP.



You will have to navigate to the the 'Listener.php' file in:
/src/addons/xenMade/STWFAR

Then edit its line 31 to have it become what I have below:
$watchRepo->setWatchState($forum, $entity, 'thread', 1, 1);

Then best to rename the hashes.json file in the same folder so XenForo doesn't attempt to check the integrity of this addon, otherwise you will see an error about it failing that check on its normal maintenance.
 
Top Bottom