Page 1 of 1

Messages plugin Invalid Recipient issue

Posted: 2022-09-27 07:20
by zibrahim
Hi there,
I have installed the Appgini Messages plugin and configured it as instructed in the video.
I can send messages from the Admin to user1 & user2.
However, I could not send the message from user1 to user2 or to Admin.
The "Invalid recipient" message slide from the bottom after clicking the Send button.
SCR-20220927-l9h.png
SCR-20220927-l9h.png (52.54 KiB) Viewed 11670 times
I have done the settings as instructed...
SCR-20220927-kjj.png
SCR-20220927-kjj.png (109.77 KiB) Viewed 11670 times
Is there any setting that I missed out ?
I am using the latest Messages plugin version 1.2 with Appgini 22.14.1293

Appreciate your help. Thanks

Re: Messages plugin Invalid Recipient issue

Posted: 2022-10-27 00:48
by ozcpa
Did you ever get a response to this issue? I have exactly the same issue. I am testing using XAMPP on localhost. I have sent a Bug Report to the plugin developer and I am awaiting a reply.

Re: Messages plugin Invalid Recipient issue

Posted: 2022-10-29 05:15
by zibrahim
Hi there,
The AppGini team is still investigating this issue after they managed to reproduced the error.
As a temporary fix, add the group in the canSend method in MessageDB.php file.
The file is located in plugins/messages/app-resources/MessageDB.php
(around line 84)
Just add the group(s) which you want to enable them to send messages under the // admins group always allowed comment.
Sample code below.

Code: Select all

		public static function canSend($recipients = null) {
			static $allowedRecipients = null;
			if($allowedRecipients === null) {
				$mi = getMemberInfo();

				// admins group always allowed
				if($mi['group'] == 'Admins') return true;
				if($mi['group'] == 'Partner') return true;
				if($mi['group'] == 'Lawyer') return true;
				if($mi['group'] == 'Pupil') return true;
				if($mi['group'] == 'Intern') return true;
				if($mi['group'] == 'Account') return true;

				$allowedRecipients = array_merge(
					self::listAllowedRecipients('users'),
					array_map(
						function($g) { return "group:$g"; }, 
						array_keys(self::listAllowedRecipients('groups'))
					)
				);

				if(self::groupPermissions()['canSendGlobalMessage'])
					$allowedRecipients[] = '__ALL_USERS__';
			}
Good luck.

Re: Messages plugin Invalid Recipient issue

Posted: 2023-05-10 17:29
by ronwill
Not working for me!

Have followed the guide but issues with not working when trying to send to group or multiple users via hooks and new record added. Sometimes have managed to get message to a single user (admin) but not the second user (also an admin).

Ron

Re: Messages plugin Invalid Recipient issue

Posted: 2023-05-10 17:40
by ronwill
Having issue with Messages PlugIn

This does not work

Code: Select all

	'recipients' => [
		'group:accountants',
		'group:sales',
		'jack',
		'dorothy'
	],
I tried my group:customers both with and without named users - my app 'hangs' with no response.

Also

Code: Select all

	/* send the message to all users of the accountants group */
	'recipients' => 'group:accountants',
I changed to group:Admins to suit my app and does not work (I have 2 admins)

Also

Code: Select all

'recipients' => 'jack','dorothy',
Fails - I swapped out to two users in my app and message only goes to first listed user - in the example sends only to Jack !!

Strange, anyone else having issues?

Re: Messages plugin Invalid Recipient issue

Posted: 2023-05-18 11:27
by crnjak
I have now same issue. How to fix this?

Re: Messages plugin Invalid Recipient issue

Posted: 2023-05-24 16:26
by xbox2007
hello
me also have same problem , i send message for support but nobody care to answer !!!!!

Re: Messages plugin Invalid Recipient issue

Posted: 2023-05-26 15:21
by a.gneady
I'm aware of the issue and working on a fix for it that we'll release as soon as possible.

Re: Messages plugin Invalid Recipient issue

Posted: 2023-05-27 18:50
by a.gneady
I'm pleased to announce a new release of the Messages plugin (v 1.3) that fixes this issue and a couple more. Please download it and let me know your feedback :)

Re: Messages plugin Invalid Recipient issue

Posted: 2023-05-30 01:25
by zibrahim
Hi there,
I have tested the latest version and so far so good. Messages could be sent and received across groups.

However, I found and issue with the insertion of the message icon code during installation to hooks/header-extras.php ...
The issue is the php tag was missing during insertion.
SCR-20230530-ioqu.png
SCR-20230530-ioqu.png (30.9 KiB) Viewed 11040 times
which caused
SCR-20230530-ioih.png
SCR-20230530-ioih.png (35.82 KiB) Viewed 11040 times
Also it would be nice if insertion comment is included like other plugins
SCR-20230530-irwd.png
SCR-20230530-irwd.png (35.02 KiB) Viewed 11040 times
Anyway, thank you for the update and hope it can be fixed soon.

Re: Messages plugin Invalid Recipient issue

Posted: 2023-05-30 10:59
by a.gneady
However, I found and issue with the insertion of the message icon code during installation to hooks/header-extras.php ...
The issue is the php tag was missing during insertion.
If the header-extras.php file already includes PHP code, it could confuse the plugin, appending the include line without opening a PHP tag first since it's appending to an already open PHP tag .. I'll investigate this further and see how to fix it.
Also it would be nice if insertion comment is included like other plugins
Thanks for your suggestion. Will do this in the next release.