[BETA] [3.2] Prime Notify

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Post Reply
User avatar
primehalo
Former Team Member
Posts: 2988
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

Enable for Posts:
Include the content of a post in the notification email sent to users.

Enable for Private Messages:
Include the content of a private message in the notification email sent to users.

Keep BBCodes:
Emails are sent as plain text so BBCodes don’t get converted to formatting. Keeping them may help to show the intended formatting while removing them may make the message look cleaner.

Email on each new post:
Send a notification email for each new post made in the subscribed topic or forum. Normally a notification email is sent only for the first new post since the user’s last visit to the topic.

Limit Message Length:
Truncates messages longer than the specified character limit. Set to 0 for no limit.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
NastyBoy
Registered User
Posts: 137
Joined: Wed May 31, 2017 7:03 pm
Location: Germany
Name: Tim
Contact:

Re: [BETA] [3.2] Prime Notify

Post by NastyBoy »

ok thank you
masing
Registered User
Posts: 7
Joined: Thu May 17, 2018 1:39 pm

Re: [BETA] [3.2] Prime Notify

Post by masing »

primehalo wrote: Tue May 22, 2018 5:32 pm The user preferences are stored in the config table, can you check your phpBB's config database table and see if the primenotify_always_send, primenotify_enable_pm, primenotify_enable_post, and primenotify_keep_bbcodes entries are in it?
Hi primehalo,

these are the entries in phpBB's config database:
primenotify_always_send 2 0
primenotify_enable_pm 2 0
primenotify_enable_post 2 0
primenotify_keep_bbcodes 1 0
primenotify_truncate 0 0

Don´t know what the numbers are for, but at least no entry is missing - Do you have yet another idea? :?
User avatar
primehalo
Former Team Member
Posts: 2988
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

I'd say completely remove it (disable it, delete the data, then delete the extension's folder) then download the latest version and do a fresh install.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
masing
Registered User
Posts: 7
Joined: Thu May 17, 2018 1:39 pm

Re: [BETA] [3.2] Prime Notify

Post by masing »

Same effect with a fresh install (and prime notify beta 7). Tried also with the default prosilver style - without sucess.

So only thing left are some sideeffects from other plugins we use, e.g. mediaembed or add user.
On a testmachine we´ll try a clean phpBB installation, without any extension. Then install prime notify and if this works, activate all the other stuff step by step ....
Thanks for your suggestions!
masing
Registered User
Posts: 7
Joined: Thu May 17, 2018 1:39 pm

Re: [BETA] [3.2] Prime Notify

Post by masing »

After a clean install of phpBB and installation of prime notify (with the addition of the german language pack), the problem is there immediately.
Now I´m clueless..... :(
koraldon
Registered User
Posts: 530
Joined: Sat Jun 30, 2007 12:42 pm

Re: [BETA] [3.2] Prime Notify

Post by koraldon »

Using beta6, it seems to crash if there is emoji in the message... Saying it is unable to put it into the notification table or such.
joshwh88
Registered User
Posts: 4
Joined: Thu Jul 05, 2018 1:32 pm

Re: [BETA] [3.2] Prime Notify

Post by joshwh88 »

Hi primehalo,

Great extension.

That being said, I've been using it on a test board and have encountered one problem.

Users that registered after the extension was enabled aren't receiving emails and the prime notify settings don't show up in their UCP. It seems the extension as a whole doesn't get applied to them. After disabling and re-enabling the extension, emails are now being sent to the new users, but the settings still do not show up in the UCP (not a problem for my board, but it may be problematic for others).

Do you know how to fix this? Because it would be annoying to have to always remember to disable and enable the extension after each new user is added.
User avatar
primehalo
Former Team Member
Posts: 2988
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

Sorry for the delay, I have been hard at work on another project and didn't have much time for anything else. I have just posted v1.0.0 Beta 8 which should fix the bug where new users don't have their notification settings enabled by default. I found the section of code that added a new user and where it sets the default notification settings and was able to hook into that to add our default notification settings. This version also changes how the notification types are handled when enabling and disabling the extension. When enabled, it makes primenotify copies of all existing user notification types instead of trying to change the existing types into a primenotify type. I wasn't sure if keeping the original type around would cause two emails to be sent but in my tests I only ever received one email and it was the one with the message. This version also fixes an SQL error that could have occurred when uninstalling the extension.

I do not know if this would fix the bug where the notification option checkboxes would not operate correctly as I was never able to replicate that bug.

I was also never able to replicate the emoji crash bug. Has anyone else been able to replicate this bug aside from koraldon? I have tried many variations and combinations of emojis and they are always stored just fine. koraldon, can you check the structure of your phpbb_notifications table to see if it's different from mine? I have the notification_data as being a text field with a utf8_bin collation.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
joshwh88
Registered User
Posts: 4
Joined: Thu Jul 05, 2018 1:32 pm

Re: [BETA] [3.2] Prime Notify

Post by joshwh88 »

Thanks for the update. It fixed the email problem, though I still can't see the settings in the UCP for a new user and users that registered after the install of the beta7 version (again, this problem is not an issue for me - just thought I'd mention it). But seeing as though you can't replicate this its probably something on my end causing this.

Thanks again!
User avatar
primehalo
Former Team Member
Posts: 2988
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

joshwh88 wrote: Wed Aug 15, 2018 3:08 pm Thanks for the update. It fixed the email problem, though I still can't see the settings in the UCP for a new user and users that registered after the install of the beta7 version (again, this problem is not an issue for me - just thought I'd mention it). But seeing as though you can't replicate this its probably something on my end causing this.

Thanks again!
I'd like to get all known bugs squashed before attempting to submit it to the extensions database.

There are two things that determine if the user settings show up:
  1. User has email notifications enabled for subscribed topics/forums.
    Image

    Internally this looks like:

    Code: Select all

    $user_notifications = $this->get_user_notifications($user_id);
    $user_post	= !empty($user_notifications['primehalo.primenotify.notification.type.post'][0]['notify']) || !empty($user_notifications['primehalo.primenotify.notification.type.topic'][0]['notify']);
    $user_pm	= !empty($user_notifications['primehalo.primenotify.notification.type.pm'][0]['notify']);
    This can be confirmed by looking at the user_notifications database table. Filter the rows to only show a specific user_id and then see if primehalo.primenotify.notification.type.post/topic is there in the item_type column, and if it is then if notify is set to 1.
    .
  2. Extension settings (on the ACP Extensions tab) set to User's Choice. Internall this looks like:

    Code: Select all

    $show_enable_post	= ($this->config['primenotify_enable_post']	== prime_notify::USER_CHOICE) && $user_post;
    $show_enable_pm		= ($this->config['primenotify_enable_pm']	== prime_notify::USER_CHOICE) && $user_pm;
    $show_keep_bbcodes	= $this->config['primenotify_keep_bbcodes']	== prime_notify::USER_CHOICE;
    $show_always_send	= ($this->config['primenotify_always_send']	== prime_notify::USER_CHOICE) && $user_post;
    This can be confirmed by looking at the phpbb_config database table. Look for any config_name column that starts with primenotify_ and if the value is 2 then it's set for User's Choice.
If both of those are true then user settings should be showing up in the UCP > Board preferences > Edit global settings section. I would have liked to have displayed them in the Edit notification options section but there was nothing in that template file to hook into.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
LoRoller
Registered User
Posts: 13
Joined: Wed Jun 13, 2018 10:34 pm

Re: [BETA] [3.2] Prime Notify

Post by LoRoller »

We just got a request for this feature today and am happy to see your project at such an advanced state.

I had to modify the various notification emails from our board because our host (GoDaddy) decided that the subjects of the mails (for admin messages, posts and private messages) looked too much like spam and trashed them on the way out. Does your system replace the existing email templates or add new ones? I'll need to know where they are to modify them, assuming you retained the original subjects.

Thanks!
User avatar
primehalo
Former Team Member
Posts: 2988
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

LoRoller wrote: Thu Aug 16, 2018 1:34 am We just got a request for this feature today and am happy to see your project at such an advanced state.

I had to modify the various notification emails from our board because our host (GoDaddy) decided that the subjects of the mails (for admin messages, posts and private messages) looked too much like spam and trashed them on the way out. Does your system replace the existing email templates or add new ones? I'll need to know where they are to modify them, assuming you retained the original subjects.

Thanks!
New email templates located inside the language directory of this extension.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [BETA] [3.2] Prime Notify

Post by 3Di »

primehalo wrote: Wed Aug 15, 2018 6:39 pm I would have liked to have displayed them in the Edit notification options section but there was nothing in that template file to hook into.
No need to hook in the templates, that's automatic.

Add this function in your notifications's type(s), like here: https://github.com/primehalo/primenotif ... st.php#L32

Code: Select all

	/**
	 * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)
	 *
	 * @return bool True/False whether or not this is available to the user
	 */
	public function is_available()
	{
		return true;
	}
You should probably set the language key for those, if not already done.
Proof of concept: http://prntscr.com/kjjo6o

There is also another function you are not using there..

Code: Select all

	/**
	 * Get email template
	 *
	 * @return string|bool
	 */
	public function get_email_template()
	{
		return false;
	}
Which should help you out, instead of using a custom approach.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
primehalo
Former Team Member
Posts: 2988
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

3Di wrote: Thu Aug 16, 2018 10:59 pm
primehalo wrote: Wed Aug 15, 2018 6:39 pm I would have liked to have displayed them in the Edit notification options section but there was nothing in that template file to hook into.
No need to hook in the templates, that's automatic.

Add this function in your notifications's type(s), like here: https://github.com/primehalo/primenotif ... st.php#L32

Code: Select all

	/**
	 * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)
	 *
	 * @return bool True/False whether or not this is available to the user
	 */
	public function is_available()
	{
		return true;
	}
You should probably set the language key for those, if not already done.
Proof of concept: http://prntscr.com/kjjo6o
When I was talking about the extension's notification options I was referring to the options which I currently have displayed in the UCP > Board preferences > Edit global settings section:

Image

I thought my NOTIFICATION EMAILS section would be a better fit under the Edit notification options section rather than the Edit global settings but I couldn't find any way to add a section there.

The actual notifications are supposed to replace the default email notifications for topic/post/pm so they should be in the same place as the default ones, replacing them, not listed in addition to the default ones.
3Di wrote: Thu Aug 16, 2018 10:59 pm There is also another function you are not using there..

Code: Select all

	/**
	 * Get email template
	 *
	 * @return string|bool
	 */
	public function get_email_template()
	{
		return false;
	}
Which should help you out, instead of using a custom approach.
I tried that originally and it didn't work which is why I figured I had to do the custom approach. I just tried it again and it still isn't working. It only seems to look in the board's default language path and not the extension's language path. To test again I gave my email template a unique name, primenotify_topic_notify.txt (in testboard/ext/primehalo/primenotify/language/en/email) and then returned 'primenotify_topic_notify' from get_email_template() which I added in my testboard/ext/primehalo/primenotify/notification/type/post.php file. When I try it out I get the message "Unable to find template "primenotify_topic_notify.txt" saying that it looked into testboard/language/en/email directory.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
Post Reply

Return to “Extensions in Development”