WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
[resolved] Mailing lists with WP-Members (6 posts)

  1. kennywright
    Member
    Posted 3 years ago #

    Is there a way to create an opt-in mailing list option during the registration process (eg: "Yes, I would like to receive e-mail announcements in the future.")? I don't really need anything fancy, but would be nice to have a checkbox listed here, just to gauge interest.

    Also, does anyone have a suggestion on a good plug-in to actually send the mail/announcement out?

  2. Chad Butler
    Member
    Plugin Author

    Posted 3 years ago #

    Currently, the best way to achieve this would be to customize the fields. I am running behind on documenting all of the new features for the new 2.5 release, but it does include initial support for adding checkbox fields to the registration.

    In future versions, I am expanding this to include radio fields and drop down lists (I know that's not really your question, but its a preemptive answer to the natural followup question from other readers regarding field types). I am also working on support for managing custom fields via the admin panel rather than programmatically.

    So, coming back to your question... You could add a check box custom field, but you then need the ability to manage the users and the email list. That will take some logistical thinking on your part, but the features that are there to help would be that there is a user export feature so that if the process you are using is external (such as ConstantConact, etc.) you can export user data, including the opt-in field and manage it accordingly. WP-Members also has the ability to grab just the non-exported users for each export so you don't have to export the entire list everytime.

    And how to get the custom checkbox field? As I mentioned, I'm a little behind on new feature documentation. The process for 2.3.2 and earlier is outlined here. In 2.5, this is simplified by the fact that there is a toggle in the install file to force a settings update so you don't have to delete as before. Using the toggle, you can now just deactivate/reactivate. The process for using the toggle is commented in the install file itself.

    Also in the install file, you will find some additional comments showing some sample arrays for the use of checkbox fields. This information was not included as of 2.3.2 and therefore isn't discussed in the post that I referenced above. Essentially, there are two additional fields in the array, one to indicate the checked value, and the other to indicate whether it should be checked by default. You can name the field whatever you need to in order to pull it into any other process for managing your process.

    Hope all of this makes some sense and helps get you where you need to be...

  3. kennywright
    Member
    Posted 3 years ago #

    OK, I see the array in the install file, but I confess to be not very PHP literate. I've moved the array out of the comment area, but I'm not sure I have the values correct. I've deactivated and activated, but my custom field is not showing up. Here's what I added:

    array ( 17, __('Add me to your email list','wp-members'), 'checkedbydefault', 'checkbox', 'y', 'n', 'n', 'checked value', 'y' )

    I'm guessing the bit after 17, is wrong, though. The example has it:
    array ( 17, 'checked by default', 'checkedbydefault', 'checkbox', 'y', 'n', 'n', 'checked value', 'y' )

  4. Chad Butler
    Member
    Plugin Author

    Posted 3 years ago #

    Actually, what you have there will work. What you need to do to force in the new settings is to use the toggle near the top of the install file $chk_force. Change this value to true, then deactivate/reactivate. That should work.

    (The __() wrapper is for localization/translation. You don't need that for adding a custom field, since you would be putting it in in your own language. Thus the example lacks this. But what you have is actually correct and would also work. You might, however, consider changing 'checked value' to be what you want the checked value to be, such as 'add', 'true', 'y', '1', or anything that would indicate they have checked the box and want to be added to your list.)

    Hope that helps.

  5. kennywright
    Member
    Posted 3 years ago #

    That worked. Easy. Thanks so much for your help in this and the other thing, and I'll look forward to 2.5.1!

  6. Chad Butler
    Member
    Plugin Author

    Posted 3 years ago #

    Glad to hear it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags