Closed (fixed)
Project:
Simplenews RealName
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2010 at 10:07 UTC
Updated:
21 Nov 2010 at 22:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
sgabe commentedSure, absolutely. This can be easily done with Chaos tool suite's dependent tool and some modification based on Skip Validation. The attached patch hides the "Name" field and skips the validation on unsubscription. Please, test it and report back.
Note that you need to install and enable Chaos tool suite to toggle the visibility of the "Name" field!
Comment #2
sgabe commentedCommitted to both branches.
Note that the visibility toogle for the "Name" field works only in the 1.x branch, since only that uses radios to choose to subscribe or unsubscribe. However the "Name" field is not validated as required field if the user choose to unsubscribe from a newsletter.
See the patches attached to easier review, but you can test the development snapshots.
Comment #3
gaele commentedThanks. I'll test tomorrow, when the new dev snapshots are published.
Comment #4
gaele commentedHi, I tested with 6.x-1.x.dev. Showing/hiding the Name field seems to work as expected. However I encountered two bugs.
- logged in: after subscribing followed by unsubscribing the corresponding row in table simplenews_realname is not deleted.
- not logged in: subscribing yields this error: warning: mail() expects parameter 1 to be string, array given in [...]/includes/mail.inc on line 193.
Comment #5
sgabe commentedAbout the first one, were you subscribed for multiple newsletters?
Comment #6
gaele commentedNo, only one newsletter is available.
Comment #7
sgabe commentedOkay, I found the problem. Actually the submit callback never runs for registered users on unsubscription. Please test the attached patch.
Comment #8
gaele commentedThe first bug is solved. The second still exists.
In simplenews_realname_mail_alter():
$recipient should be a string. Perhaps you where thinking of "User <user@example.com>"?
Comment #9
sgabe commentedWhat Mime Mail version and mail engine are you using?
Comment #10
gaele commentedsendmail
But this looks like a PHP limitation. mail.inc calls PHP mail. http://php.net/manual/en/function.mail.php:
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )Comment #11
sgabe commentedI mean what mail engine for Mime Mail? Default, SMTP, PHPMailer etc? Mime Mail accepts array for the recipient and converts it to string.
Comment #12
gaele commentedAh I see. mimemail 6.x-1.0-alpha6 with default engine ('mimemail').
Comment #13
gaele commentedThe subscription mail sent by simplenews is just plain text, though. Mimemail isn't used.
Comment #14
gaele commentedThis is working for me (taken from mimemail_address()):
Comment #15
sgabe commentedNote that Windows based systems will reject formatted addresses, we need to check that first.
Comment #16
sgabe commentedComment #17
sgabe commentedCommitted to both branches. I hope all of this is fixed now. Thanks!
Comment #18
gaele commentedThank you sgabe!