Add Email Subscriptions to WordPress Site

what is email subscription? when you publish new article in your site that time, you want to send email to all your subscribers. Simply that called email subscription.

Importance of Email subscription

Add Email Subscriptions to WordPress Site
Add Email Subscriptions to WordPress Site

First benefit is, you can increase your  site visitors and views using email subscriptions. You will be able notify your wordpress user about site activity and new articles or posts. It will attract more readers to your website.

List of WordPress plugins for email subscription

Simple Subscribe

Simple Subscribe
Simple Subscribe

Simple Subscribe is the only bulletproof secure plugin, that is easy to use and developers friendly as well. It gives you the power to simply add subscription form to your WordPress website, as a widget, shortcode or using php in your template codes.

This plugin has integrated ReadyGraph, an optional set of features to automate the growth of your userbase. It helps you achieve the three goals of any web marketer: maximize conversion of site visitors to register for your email list, maximize viral referrals for your site, and maximize return visits to your site. To accomplish this, we have integrated a key set of growth features with this plugin: – Intelligent signup popup with email or one-click Facebook login – Full viral referral flow – Automated end user re-engagement emails including welcome emails, weekly digest, friend joined alert and more (all email campaigns are optional and configurable) – Enhanced email deliverabilty – Cloud-based analytics and data storage – Settings that allow you to turn on and off all ReadyGraph features.

Email Subscription

The plugin provides a admin page where you can customize the emails to be sent. There is also a widget to be customized in the widget panel. The plugin uses WordPress schedule events (wp-cron) to schedule emails. For more information see installation page or the Webfish homepage.

Feedburner Email Subscription

Feedburner Email Subscription
Feedburner Email Subscription

This plugin gives your biggest fans another way to keep up with your content feed by placing an email subscription form on your site. The email subscription uses the Feedburner RSS driven service to fetch your site content, and deliver it to your subscribers. Easy to use and customize, just put your Feedburner site name and you are ready to launch. Email content sent automatically by Feedburner.

Subscribe2

Subscribe2

Subscribe2 provides a comprehensive subscription management and email notification system for WordPress blogs that sends email notifications to a list of subscribers when you publish new content to your blog.

This plugin has integrated ReadyGraph, an optional set of features to automate the growth of your userbase. It helps you achieve the three goals of any web marketer: maximize conversion of site visitors to register for your email list, maximize viral referrals for your site, and maximize return visits to your site. To accomplish this, we have integrated a key set of growth features with this plugin: – Intelligent signup popup with email or one-click Facebook login – Full viral referral flow – Automated end user re-engagement emails including welcome emails, weekly digest, friend joined alert and more (all email campaigns are optional and configurable) – Enhanced email deliverabilty – Cloud-based analytics and data storage – Settings that allow you to turn on and off all ReadyGraph features.

wordpress user search firstname lastname and display name code

In wordpress admin users listing page, wordpress admin has user search with username and email but we cannot search via display name or first name and last name.

We can add firstname, lastname and display name in users search. You just need to add following code.

/*
 * functions will be applicable for only wordpress admin
 */
if (is_admin()) {
 /*
 * Modify the User Search in Admin to include firstname, lastname and display_name
 */
 add_action('pre_user_query', 'wpapi_pre_user_query');

function wpapi_pre_user_query($user_search) {
 //die();
 global $wpdb;
 // print_r($user_search);
 $vars = $user_search->query_vars;
 if (!is_null($vars['search'])) {
 /* For some reason, the search term is enclosed in asterisks.
 Remove them */
 $search = preg_replace('/^\*/', '', $vars['search']);
 $search = preg_replace('/\*$/', '', $search);
 //print_r($search);
 //search in display name
 if(!empty($search)){
 $user_search->query_where = substr(trim($user_search->query_where), 0, -1) . " OR display_name LIKE '%". $search . "%')";
 }

 $user_search->query_from .= " INNER JOIN {$wpdb->usermeta} m1 ON " .
 "{$wpdb->users}.ID=m1.user_id AND (m1.meta_key='first_name')";
 $user_search->query_from .= " INNER JOIN {$wpdb->usermeta} m2 ON " .
 "{$wpdb->users}.ID=m2.user_id AND (m2.meta_key='last_name')";
 $names_where = $wpdb->prepare("m1.meta_value LIKE '%s' OR m2.meta_value LIKE '%s'", "%{$search}%", "%$search%");
 $user_search->query_where = str_replace('WHERE 1=1 AND (', "WHERE 1=1 AND ({$names_where} OR ", $user_search->query_where);
 }
 return $user_search;
 }

}

wordpress user search firstname lastname and display name code
wordpress user search firstname lastname and display name code

how to send email using php – Using PHPmailer

Many PHP programmers facing this issue and hitting same wall. Here in article we shown, how to send email using php. we given code sample with phpmailer.

how to send email using php

how to send email using php - PHP tutorial
how to send email using php – PHP tutorial

PHP itself provides the mail() function to send emails. In this article I will show you the options of sending email using PHP language.

If you are using linux or windows hosting service for running the PHP application. PHP mail() function uses the sendmail mail server to send emails.
If sendmail mail server is configured and running on linux server then only mail() function is able to send the emails.

First we will talk about mail() function. You can pass the following parameters to mail function.

mail(to,subject,message,headers,parameters)

Sample code as follows:

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
$to = "support@purabtech.in/files/, wordpressapi@gmail.com";
$subject = "Test mail";
$message = "This is a simple email message.
 this is seond line.";
$from = "some@example.com, wordpressapi@gmail.com";

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $from";

$headers .= 'Cc: test@test1.com' . "\r\n";
$headers .= 'Bcc: test2@test1.com' . "\r\n";

mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>

If sendmail mail server is not configured on your server, mostly with windows server then there is issue.
But you can send email using anothere PHP programm called PHPmailer.
you can download the PHPmailer from following URL:

http://sourceforge.net/projects/phpmailer/

Download first PHPmailer and extract the phpmailer folder and in that folder you will find the following three files.
1. class.phpmailer.php
2. class.pop3.php
3. class.smtp.php

copy and paste the following files to your PHP application. and use the following code in case of use POP email

<?php
function sendmail_wordpressapi($to,$from,$subject,$body,$id){
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
include_once('class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail             = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = "purabtech.in/files/"; // SMTP server
$mail->From       = $from;
$mail->FromName   = $from;
$mail->Subject    = $subject;
$mail->Body       = $body;
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap   = 50; // set word wrap
$mail->MsgHTML($body);
$mail->AddAddress($to, $to);

if(!$mail->Send()) {
$mail             = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
$mail->Username   = "WORDPRESSAPI@gmail.com";  // GMAIL username
$mail->Password   = "YOURPASSWORD";            // GMAIL password
$mail->AddReplyTo("smtp.production@gmail.com","wordpressapi");
$mail->From       = "support@purabtech.in/files/";
$mail->FromName   = "SMTP EMAIL-wordpressapi";
$mail->Subject    = "email server is having some issue";
$mail->Body       = "Hi,<br>email server is having some issue,<br> check this out";                      //HTML Body
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap   = 50; // set word wrap
$mail->MsgHTML($body);
$mail->AddAddress("support@purabtech.in/files/", "support-wordpressapi");
$mail->IsHTML(true); // send as HTML
$mail->Send();

} else {
 echo "Message sent!";
}
}
?>

I created above function in this function I am using SMTP mail function for sending email but in case mail is not going using SMTP details.
you can also send emails using your gmail account details. you can edit or use this function as your requirement.

You can pass following parameters to sendmail_wordpressapi function:

sendmail_wordpressapi($to,$from,$subject,$body,$id);

You can send email to multiple email addresses. I am sure using above code sending emails through PHP is very easy. If you have any quries..write to me.

Share Thunderbird Between Windows and Linux

Many people are using Thunderbird as a email client.

I am using the Windows xp and Fedora 8 (Dual boot OS) on my System. Two years back i was using Microsoft office Outlook for viewing the emails.

Later on i need to work on Linux also. For email check i always i need to go or restart the system and start the Outlook.

Then i moved to Thunderbird which is Open source and free. Important thing is Thunderbird works on Linux and windows both.

My Tip :Share Thunderbird Between Windows and Linux

I installed the Thunderbird for Windows. First save all settings. Then follow my steps:

1. Open Thunderbird ->Click on Local Folders button(Top left button)

2. Choose or click on-> View settings for this account

3. Choose or click on-> Local Folders

4. First go that location by browsing the explorer and copy the folder and paste into your d:  drive.

5. Restart the thunderbird.

thunderbird

You need installed Samba windows share program in your Linux OS. Samba share is the free linux utility for checking windows files or drive.

Then go to Linux OS. and follow the save stages. Which i mentioned in top.

You will be able to use or check same emails on Windows and Linux.

Enjoy.