Subscribe by Email and Facebook

I have the plugins: subscribe by email, ultimate facebook, slide-in/popup.

How can I use these together to allow a user to easily subscribe to a network site using their email or facebook?

  • Milan
    • WordPress Wizard

    Hello fonderco ,

    Hope you are well today and thanks for asking us. :slight_smile:

    You want mechanism in which user can register on your main network blog or marketing strategy with these plugins to make user subscribe for posts ?

    Please advise. :slight_smile:
    Best Regards,

  • fonderco
    • Design Lord, Child of Thor

    Basically I want to use the Subscribe by email and the Ultimate Facebook plugins together. So, a user can subscribe using the Facebook Connect and their facebook profile. So, they don't have to put in their email just click the button.

  • Adam Czajczyk
    • Support Gorilla

    Hello fonderco!

    Currently these two plugins are not integrated. The Subscribe by Email plugin requires user to fill in subscription form and Ultimate Facebook can't do this automatically.

    A workaround that I'm thinking of may be to use Ultimate Facebook in a regular way so users could login/register via Facebook to your site (you could also put a FB Connect widget near the Subscribe form on page) and then use some custom code to "pre-fill" the subscription form with user e-mail address fetched from his/her profile.

    There are two aspects of such an approach though that are worth noting:

    1. Subscription "by Facebook" would automatically create a user account for that user on your site (register user)

    2. This would also automatically subscribe all logged in users of your site.

    I haven't tried that yet but it should be doable with a bit of custom code. The workflow of the code would be like this:

    - fetch logged in user's e-mail address from his/her profile
    - fill subscription widget form with that e-mail with JS
    - submit form with JS

    This code seems to be working fine on my test setup:

    function auto_subscribe_by_email() {
    	$logged_user = wp_get_current_user();
    	$logged_user_mail = $logged_user->user_email;
    	<script type="text/javascript">
    	document.getElementsByClassName('sbe-widget-form-field')[0].setAttribute("value", "<?php echo $logged_user_mail;?>");

    To use it create an empty file with a ".php" extension, put the code inside and upload it to your server to the "/wp-content/mu-plugins" folder. If there's no "mu-plugins" folder inside "wp-content" folder, simply create it.

    The code takes an e-mail of a logged in user and then if there's a Subscribe by E-mail widget on a page it fills in the form and submits it automatically. If a user is already subscribed and logged in the subscription form won't be visible (Subscribe by Email plugin takes care of it) and instead an information of subscription will be shown - therefore the form won't be filled and submited again.

    Depending on your policy you may or may not enable "auto opt-in" option in Subscribe by Email settings. If it's disabled, there'll be a "Thank you" message shown until user confirms subscription by clicking on a link in a confirmation e-mail. Otherwise, user should be fully subscribed automatically.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.