• Resolved otta88sun

    (@otta88sun)


    Hi,
    nice plugin! I’m setting up a function that automatic send newsletter every published post.

    Instead send to all I’ld like to send only to who have settet in their profil che checkbox “Allow to receive post/page notification”.

    Is there a function to get if a user (while loop) has checked or not this option?

    Thank you
    WEPAVIA.com

    https://www.ads-software.com/plugins/email-users/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter otta88sun

    (@otta88sun)

    I found my own solution. Using plugin “Types” i setted a custom user field. Then checking that i understand if yes or not.

    Plugin Author Mike Walsh

    (@mpwalsh8)

    Sorry I missed this question earlier. In Email Users the allow post/page notification is stored as user meta data. You can use the standard WordPress user meta functions to check if a user has chosen to receive notifications or not.

    The Email Users plugin defines two constants, one for each meta value:

    // User meta
    define( 'MAILUSERS_ACCEPT_NOTIFICATION_USER_META', 'email_users_accept_notifications' );
    define( 'MAILUSERS_ACCEPT_MASS_EMAIL_USER_META', 'email_users_accept_mass_emails' );

    You can check the value like this:

    get_user_meta($user_id, MAILUSERS_ACCEPT_NOTIFICATION_USER_META, true)

    Hope that helps.

    Thread Starter otta88sun

    (@otta88sun)

    Hi man,
    will be sure helpfull for someone. However i got the need of make choice between Show newsletter: yes, no, only news, and of course i needed a custom meta user.

    Thank you however, your plugin is usefull to me for send broadcast custom email ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Function to get which user allow receive email’ is closed to new replies.