I previously had anonymous subscriptions working great with plain text 'mail' as the send method. I recently installed and configured MimeMail as the default send method for anonymous users and the subscriptions are no longer excepted:
You need to enter exactly one destination address.
This error is thrown when an anonymous user attempts to subscribe. Authenticated users have no issues subscribing, only anonymous.
There seems to be some conflict with Notifications validating MimeMail as the send method when the form is submitted. I thought perhaps the two weren't designed to work together (anonymous and MimeMail), but there is a specific setting to enable MimeMail for anonymous users here: sitename.com/admin/messaging/notifications/subscriptions/anonymous under Allowed Messaging Methods.
My use case is 'Subscribing to all content of type: Blog'. Again, all permissions are correct as I previously had anonymous users subscribing to 'Blogs' and the ONLY thing that has changed on the site is installing MimeMail and setting it as the default for anonymous users at the previously mentioned location.
Perhaps this is a bug, or by design. Either way, your help is appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | anon-mimemail-subscriber-method-fix-1099658-6.patch | 702 bytes | danquah |
Comments
Comment #1
Lloyd Standish commentedI have the same problem with the latest development version (can't use mimemail with anonymous users). Would really appreciate any help to get this working.
Comment #2
Poieo commentedWe never solved this...and it doesn't look like it's going to get fixed.
As a work around, we setup a script to run on cron that updates send method from mail to mimemail for all users. Obviously this doesn't work if you want people to be able to choose what method they get.
We just set the default method to mail to get rid of the error and allow people to subscribe. Then, the script updates their method.
You can put the following in a custom module:
Comment #3
skapto commentedLine 165 in includes/destination.inc looks for the method in the values of the $address_method hash, and can't find it because it's in the keys.
Inverting the hash by replacing line 108 with the following line solves it for me.
$address_method[$type] = $method;Comment #4
marinex commentedI look at the code in destination.inc and default method "mail" of drupal works because the key of array is "mail" and the variable $key is "mail" too (in the row $method = $values['destination_methods'][$type] the variable $type is equal "mail"). Therefore right value will be returned:
[destination_methods] => Array
(
[mail] => mail
)
BUT! When will you use mimemail the key of array will be replaced by "mimemail" and because the $type is equal "mail" it will not return right value. Another bug is the value of the array because it is "mail" instead "mimemail":
[destination_methods] => Array
(
[mimemail] => mail
)
@skapto
I confirm your fix works!
Comment #5
gaëlgA fix has been proposed. Can maintainers confirm that it will work with no side-effect and then commit it? Thanks.
Comment #6
danquah commentedPatch against 6.x-4.x-dev with the change suggested ind #3 tested and attached.