Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have just one newsletter for my website. I want new users to be given the option to subscribe on the registration form (so I don't want a required list), but I want the default to be subscribed. Right now, the default is always not subscribed. Is there a way to do this through the mailchimp module (or do I have to use Drupal hooks)?
If it's not possible through module settings, has anyone done it with hook_form_alter? Any hints?
Thanks,
Maria
Comments
Comment #1
levelos CreditAttribution: levelos commentedhook_form_alter will take care of it. Just set the default_value property of the form checkbox to TRUE.
Comment #3
Lloyd CreditAttribution: Lloyd commentedCould someone please provide more detailed instructions on how to do this? Thanks.
Comment #4
levelos CreditAttribution: levelos commentedIn your module, use hook_form_alter() to change the default value of the subscribe form element to checked.
Comment #5
alexanansi CreditAttribution: alexanansi commentedI found this guide which looks like it will help you http://websmiths.co/blog/very-introduction-drupals-hookformalter