<?



### DO THIS FIRST:
require_once("/BANGK!/master_config.php");
require_once($master_config_root_path . "shared/functions.shared");
$active_user_session_timeout = "OFF"; // no session timeout on this page
require_once($master_config_root_path . "shared/session.shared");

//if($test_logging == true) logger3("_SESSION['template']['company']",$_SESSION['template']['company']);
//if($test_logging == true) logger3("0_SESSION['support_action']",$_SESSION['support_action']);
//if($test_logging == true) logger3("_GET['password']",$_GET['password']);
//if($test_logging == true) logger3("_SESSION['template']['company']['file_path']",$_SESSION['template']['company']['file_path']);

### START SESSION VERIFICATION (ALWAYS LAST B4 REST OF PAGES):
$verified_member = "no";
$verified_business = "no";
$verified_transaction = "no";
$verified_banned = "no";
$verified_acccess = "no";
include($_SESSION['template']['company']['file_path'] . "shared/start_verified_session.shared");
#
#
#
log_traffic_stats();

$test_logging = false;  // set to true or false
$test_emailing = true;
$test_datetime_status = false; // set to false for LIVE



$incoming_vars = "";
$incoming_vars = array();
if($_POST) $incoming_vars = $_POST;
if(empty($incoming_vars)) $incoming_vars = $_GET;


if($test_logging == true) logger3("












########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
### NEW SESSION:  [" . $_SERVER['SCRIPT_NAME'] . "]
########################################################################################


",$incoming_vars);
#
#
#
### START: SESSIONS & STUFF:


########################################################

### TEST TIMING // UNCOMMENT TO TURN OFF:
if($test_logging == true) logger3("test_datetime_status",$test_datetime_status);

$test_accounts_array = "";
if($test_datetime_status == true) {
	
	$test_time_current = time();
	if($test_logging == true) logger3("test_time_current",$test_time_current);
	
	$test_datetime_current = date("Y-m-d H:i:s");
	if($test_logging == true) logger3("test_datetime_current",$test_datetime_current);
	
	$test_time_in_the_future_days = 0; // test false
	//$test_time_in_the_future_days = 1; //test 24 hours
	//$test_time_in_the_future_days = 4;
	//$test_time_in_the_future_days = 10;
	//$test_time_in_the_future_days = 30;
	//$test_time_future = strtotime("+". $test_time_in_the_future_days ." days");
	
	if($test_logging == true) logger3("test_time_future",$test_time_future);
	
	$future_in_house = $test_time_in_the_future_days * 24;
	$test_time_future = strtotime($test_datetime_current . "+ ". $future_in_house . " hours");
	$test_datetime_future = date("Y-m-d H:i:s",$test_time_future);
	if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
	
	$test_accounts_array = "";
	$test_accounts_array = array();
	
	///////// emailtesta@corp.nsdb.com
	//$test_accounts_array[0]['accountid'] = "11833"; // <-- set the accountid to test
	//$test_accounts_array[0]['creator_memberid'] = "8345";  // <-- set the creator_memberid to test
	

	$use_this_emailaddress = "jan8@corp.nsdb.com";
	if($use_this_emailaddress) {
		
		$tmp_sql = "SELECT memberid FROM members WHERE emailaddress = '$use_this_emailaddress';";
		$test_memberid = getTHECASHIER($tmp_sql);
		
		$tmp_sql = "SELECT accountid FROM accounts 
					WHERE accounttype = 'BUSINESS'
					AND creator_memberid = '$test_memberid';";
		$test_memberid_accountid = getTHECASHIER($tmp_sql);
		
		$tmp_sql = "SELECT * FROM accounts WHERE accountid = '". $test_memberid_accountid ."';";
		$test_accounts_array[0] = object2array(readTHECASHIER($tmp_sql));
		
		
	
	}
	
		
}


########################################################



//https://gateway.bangk.com/photoBANGK_new_account_followups.gate?cron_password=l3mm3thru

$datetime_start_search = "2016-12-01 00:00:00";
$current_datetime = datetime();
$days_later_followup_1 = 1; // from the last update
$days_later_followup_2 = 3; // from the last update
$days_later_followup_3 = 6; // from the last update
$days_later_followup_4 = 20; // from the last update

$campign_name = $_SESSION['template']['company']['name'];
$campign_number_of_cycles = $_SESSION['template']['company']['name'];



// set test credentials if available:
if($test_logging == true) logger3("test_accounts_array",$test_accounts_array);
if(!$test_accounts_array) {

	//get the mmbers
	$tmp_sql = "SELECT *
				FROM accounts 
				WHERE accounttype = 'BUSINESS' 
				AND created > '". $datetime_start_search ."'
				ORDER BY created ASC
				;";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$accounts_array = readarrayTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("1_accounts_array",$accounts_array);
	//exit;

} else {
	
	if($test_accounts_array) $accounts_array = $test_accounts_array;
	if($test_logging == true) logger3("2_accounts_array",$accounts_array);
}



// now check to see if the members have a "ACTIVE" email address:

foreach($accounts_array as $key => $tmp_account_details) {

	if($test_logging == true) logger3("key",$key);
	if($test_logging == true) logger3("tmp_account_details",$tmp_account_details);
	$tmp_member_details = member($tmp_account_details['creator_memberid']);
	
	
	$email_subject = "";
	$email_message = "";
	$updated_followup_email_ID_last_sent = false; // defines when email has been set so as to not overwrite.
	$account_followup_status_details = "";
	$tmp_member_hash = "";
	
	$send_the_followup_to_this_emailaddress = "";
	$tmp_email_to_memberid = "";
	$tmp_sql = "SELECT emailaddress FROM members WHERE memberid = '". $tmp_account_details['creator_memberid'] ."';";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$send_the_followup_to_this_emailaddress = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("send_the_followup_to_this_emailaddress",$send_the_followup_to_this_emailaddress);
	//exit;
	
	/// figure out what email to send
	
	$tmp_sql = "SELECT * 
				FROM followup_emails 
				WHERE accountid = '". $tmp_account_details['accountid'] ."'
				AND accountid != ''
				AND accountid != '0'
				AND accountid IS NOT NULL
				;";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	
	$account_followup_status_details = readTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("account_followup_status_details",$account_followup_status_details);
	
	if($test_logging == true) logger3("account_followup_status_details->followup_emails_id",$account_followup_status_details->followup_emails_id);
	//exit;
	
	$tmp_sql = "SELECT hash FROM members WHERE memberid = '". $tmp_account_details['creator_memberid'] ."';";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$tmp_member_hash = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("tmp_member_hash",$tmp_member_hash);
	
	
	
	if($test_logging == true) logger3("tmp_account_details['hash']",$tmp_account_details['hash']);
	
		
	if(!$account_followup_status_details->followup_emails_id) {
		
		/// create a followup_emails record for this member:
		$_XXXXX_followup_emails_id = "";
		$_XXXXX_memberid = $tmp_account_details['creator_memberid'];
		$_XXXXX_accountid = $tmp_account_details['accountid'];
		$_XXXXX_member_hash = $tmp_member_hash;
		$_XXXXX_account_hash = $tmp_account_details['hash'];
		$_XXXXX_campaign_name = $campign_name;
		$followup_email_ID_last_sent = "0";
		$_XXXXX_datetime_created = datetime();
		$_XXXXX_datetime_updated = $_XXXXX_datetime_created;
		
		$tmp_sql = "INSERT INTO `followup_emails` (
		`followup_emails_id`
		, `memberid`
		, `accountid`
		, `member_hash`
		, `account_hash`
		, `campaign_name`
		, `followup_email_ID_last_sent`
		, `datetime_created`
		, `datetime_updated`
		) VALUES (
		'". $_XXXXX_followup_emails_id ."'
		,'". $_XXXXX_memberid ."'
		,'". $_XXXXX_accountid ."'
		,'". $_XXXXX_member_hash ."'
		,'". $_XXXXX_account_hash ."'
		,'". $_XXXXX_campaign_name ."'
		,'". $followup_email_ID_last_sent ."'
		,'". $_XXXXX_datetime_created ."'
		,'". $_XXXXX_datetime_updated ."'
		);";
		if($test_logging == true) logger3("tmp_sql",$tmp_sql);
		$followup_emails_id = "";
		$followup_emails_id = insertTHECASHIER($tmp_sql);
		if($test_logging == true) logger3("followup_emails_id",$followup_emails_id);
		
		$tmp_sql = "SELECT * FROM followup_emails WHERE followup_emails_id = '". $followup_emails_id ."';";
		if($test_logging == true) logger3("tmp_sql",$tmp_sql);
		
		$account_followup_status_details = "";
		$account_followup_status_details = readTHECASHIER($tmp_sql);
		if($test_logging == true) logger3("account_followup_status_details",$account_followup_status_details);
		
	}



	

	



	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	### REGISTER BUT NOT VERIFY

	
	/// check if the member has a verified email address:
	if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
	//exit;
	
	$registered_member_verified_emailaddress = false;
	$tmp_sql = "SELECT emailaddress 
				FROM email_addresses 
				WHERE memberid = '". $tmp_account_details['creator_memberid'] ."' 
				AND status = 'ACTIVE'
				;";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$registered_member_verified_emailaddress = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("registered_member_verified_emailaddress",$registered_member_verified_emailaddress);
	
	//exit;
	
	if( 
		($account_followup_status_details->followup_email_ID_last_sent <= 4)
	) {
		
		
		/// check if the member has a verified email address:
		
		
		
		//exit;
		if($registered_member_verified_emailaddress == false) {
		
			 
			$tmp_sql = "SELECT emailaddress FROM email_addresses WHERE memberid = '". $tmp_account_details['creator_memberid'] ."' ORDER BY datetime_updated DESC LIMIT 1;";
			if($test_logging == true) logger3("tmp_sql",$tmp_sql);
			$registered_member_emailaddress = "";
			$registered_member_emailaddress = getTHECASHIER($tmp_sql);
			if($test_logging == true) logger3("01_registered_member_emailaddress",$registered_member_emailaddress);
			
		
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			
			if($test_logging == true) logger3("days_later_followup_1",$days_later_followup_1);
			$hours_later = "";
			$hours_later = 24 * $days_later_followup_1;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			if($test_logging == true) logger3("current_datetime",$current_datetime);
			
			
			if($test_logging == true) logger3("account_followup_status_details->datetime_updated",$account_followup_status_details->datetime_updated);
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			
			
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "0") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
		
				/// START: send first email /////////////////////////////////////////
				
				
				$email_subject = "Getting Started with PAYYAP";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				
				
				
				
				$email_message = '<b>Greetings!</b>

Thank you for downloading/installing, PAYYAP - The Payments App.

<u>Taking credit and debit card payments has never been so easy!</u>

To begin, we just need you to <b>register and validate your email address.</b>

Simply open the PAYYAP app on your mobile device and (in the text-box), type your
preferred email address.

Then ---> "Click to Continue..."!

You will be prompted to check your inbox, (or SPAM folder) where you will find an email
from PAYYAP.network containing your Validation Link/Button. -- Click on that link/button!

And follow the 2-step instructions.

Once back in the app, you will be able to <b>configure & activate your PAYYAP
account via our quick, easy and free, activation process!</b>

It\'s really not as hard as it sounds! Go ahead and give it a shot!

If you have any questions, please do not hesitate to ask our courteous customer support
staff.

Or, visit our FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We look forward to helping you get paid!</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>

';
				
				
				//if($test_logging == true) logger3("email_message",$email_message);
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '1'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}	
			
			
			
			
		
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_2",$days_later_followup_2);
			$hours_later = 24 * $days_later_followup_2;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "1") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 2nd email /////////////////////////////////////////
				$email_subject = "Register Your Account Now!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = '<b>Greetings!</b>

If you are anything like us, time is a precious commodity!

It is for this reason that we designed PAYYAP to be the quickest and easiest (appdriven)
payments solution available!

<u>No "Squares", no "Dongles", NO HASSLE!</u>

First, we just need you to <b>register and validate your email address.</b>

Simply open the PAYYAP app on your mobile device and (in the text-box), type your
preferred email address.

Then "Click to Continue..."!

You will be prompted to check your inbox, (or SPAM folder) where you will find an email
from PAYYAP.network containing your Validation Link/Button. -- Click on that link/button!

And follow the 2-step instructions.

Once back in the app, you will be able to <b>configure & activate your PAYYAP
account.</b>

This activation process is quick, easy and free!

For further information be sure to visit our FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

Or please do not hesitate to contact our courteous customer support staff with any
questions you may have.

<b>We are here to help you!</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '2'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_3",$days_later_followup_3);
			$hours_later = 24 * $days_later_followup_3;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "2") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 3rd email /////////////////////////////////////////
				$email_subject = "Get Paid Quickly, Easily and Safely!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				
				$email_message = '<b>Greetings!</b>
				
Did you know that PAYYAP is ready and able to help you get paid - quickly, easily and
safely?

Yes! It\'s true! <u>PAYYAP is 100% safe, 100% secure, and 100% PCI/DSScompliant.</u>

However, we noticed that you haven\'t yet <b>registered and validated your email
address.</b>

Simply open the PAYYAP app on your mobile device and (in the text-box), type your
preferred email address.

Then "Click to Continue..."!

You will be prompted to check your inbox, (or SPAM folder) where you will find an email
from PAYYAP.network containing your Validation Link/Button. -- Click on that link/button!
 And follow the 2-step instructions.

Once back in the app, you can <b>configure & activate your PAYYAP account via
our quick, easy and free, activation process!</b>

For further assistance, please contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your interest in PAYYAP - The Payments App.</b>

Sincerely,

PAYYAP.network Support Staff
<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '3'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_4",$days_later_followup_4);
			$hours_later = 24 * $days_later_followup_4;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "3") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 4th email /////////////////////////////////////////
				$email_subject = "Let Us Help You Grow Your Business!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				
				$email_message = '<b>Greetings!</b>

Did you know that PAYYAP can help grow your business, by improving your daily cash
flow?

To get paid, all you need to do is <u>enter your customer\'s name, telephone number
and amount owed; and PAYYAP will take care of the rest!</u>

What are you waiting for? <b>Register your account today!</b>

Simply open the PAYYAP app on your mobile device and (in the text-box), type your
preferred email address.

Then "Click to Continue..."!

You will be prompted to check your inbox, (or SPAM folder) where you will find an email
from PAYYAP.network containing your Validation Link/Button. -- Click on that link/button!
 And follow the 2-step instructions.

Once back in the app, you will be able to <b>configure & activate your PAYYAP
account.</b>

This activation process is quick, and free!

If you have any questions, please do not hesitate to contact our courteous customer
support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you will succeed with PAYYAP!</b>

Sincerely, 

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
				   	SET followup_email_ID_last_sent = '4'
				   	,datetime_updated = '". $updated_datetime ."' 
				   	WHERE 
				   	followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				   	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				   	$update_results = updateTHECASHIER($tmp_sql);
				   	if($test_logging == true) logger3("update_results",$update_results);
				   	$updated_followup_email_ID_last_sent = true;
					
				
				
				/// END: send first email /////////////////////////////////////////
				
				
				
			}		

		}
					
	}
	
	
	
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	### was: SUBMITTED BUT NOT ACTIVATE
	### now: APPROVED BUT NOT CONFIGURED
	
	
	$account_part_1_completed = false;
	if($test_logging == true) logger3("account_configuration",$account_configuration);
	
	//$tmp_sql = "SELECT birthdate FROM members WHERE memberid = '". $tmp_account_details['creator_memberid'] ."';";
	//if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	//$member_birthdate = getTHECASHIER($tmp_sql);
	//if($test_logging == true) logger3("member_birthdate",$member_birthdate);
	
	
	#if(
	#	($member_birthdate)
	#	&& ($member_birthdate != "0000-00-00")
	#) {
	#	$account_activation_submitted = true;
	#	if($test_logging == true) logger3("2_account_activation_submitted",$account_activation_submitted);
	#}
	#
	
	
	if(
	   ($tmp_account_details['years_in_business'])
	) {
	   $account_part_1_completed = true;
	   if($test_logging == true) logger3("account_part_1_completed",$account_part_1_completed);
	}	
	
	
	//exit;
	if($test_logging == true) logger3("registered_member_verified_emailaddress",$registered_member_verified_emailaddress);
	if($test_logging == true) logger3("7_account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
	
	if( 
		($registered_member_verified_emailaddress)
		&& ($account_followup_status_details->followup_email_ID_last_sent <= 8)
	) {
		
	

		
		
		if($test_logging == true) logger3("3_account_activation_submitted",$account_activation_submitted);
		if($account_part_1_completed == false) {
		
			if($test_logging == true) logger3("account_activation_submitted",$account_activation_submitted);
			//exit;
			///send up to 4 emails:
			
			
			
			
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_1",$days_later_followup_1);
			
			$hours_later = 24 * $days_later_followup_1;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
		
			if($test_logging == true) logger3("updated_followup_email_ID_last_sent",$updated_followup_email_ID_last_sent);
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent <= "4") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
		
				/// START: send first email #5 /////////////////////////////////////////
				$email_subject = "Taking the Next Steps with PAYYAP";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				
				$email_message = '<b>Greetings!</b>
				
Are you ready to take the next steps with PAYYAP?

We can see that you have registered and validated your email address. -- That\'s fantastic! But why stop there?

Now, it\'s time to <u>configure & activate your PAYYAP account via our quick, easy and free, activation process!</u>

Simply open the PAYYAP app on your mobile device and <b>"Select Your Account" to <i>Configure & Activate.</i></b>

You will then be instructed to provide basic (but important) information, about yourself and your business.

Once your account is activated, you will be able to <b>start accepting credit (or debit) card payments from anyone; any-time, anywhere!</b>

Please let us know if you have any questions; we are happy to assist!

Or, you may also visit our FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you will succeed with PAYYAP!</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '5'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}	
			
		
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_2",$days_later_followup_2);
			$hours_later = 24 * $days_later_followup_2;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "5") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
				
				/// START: send 2nd email # 6 /////////////////////////////////////////
				$email_subject = "Activate Your Account Today!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				
				$email_message = 'Activate Your Account Today!

<b>Greetings!</b>

If you are anything like us, ease of use is essential!

It is for this reason that we designed PAYYAP to be <u>the quickest and easiest (app- driven) payments solution available!</u>

To configure & activate your PAYYAP account via our quick, easy and free, activation process, simply open the PAYYAP app (on your mobile device) and 

<b>"Select Your Account" to <i>Configure & Activate.</i></b>

You will then be instructed to provide basic (but important) information, about yourself and your business.

Go ahead... Do it now! Configure and Activate your account!
With PAYYAP you can <b><i>watch your customer pay you in real-time!</i> No "Squares", no "Dongles", NO HASSLE!</b>

For further information be sure to visit our FAQs page at: https:// support.payyap.network.

Or please do not hesitate to contact our courteous customer support staff with any questions you may have.

<b>We are here to help you!</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '6'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_3",$days_later_followup_3);
			$hours_later = 24 * $days_later_followup_3;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "6") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
				
				
				
				/// START: send 3rd email # 7 /////////////////////////////////////////
				$email_subject = "Safe and Secure Payments!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = '<b>Greetings!</b>

We noticed you haven\'t Activated your PAYYAP account yet!

Would you like to do it now?

Simply open the PAYYAP app on your mobile device and <b>"Select Your Account" to <i>Configure & Activate.</i></b>

You will then be instructed to provide basic (but important) information, about yourself and your business.

Once your Account Configuration is complete you can click: “Confirm and ACTIVATE”! <u>It\'s super easy!</u>

And in case you were wondering... <b>PAYYAP is 100% safe, 100% secure, and 100% PCI/DSS-compliant.</b>

All Account Information is held with the utmost security, privacy and respect.

If you have any questions, please let us know. We are happy to assist!

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your continued interest in PAYYAP - The Payments App.</b> 

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '7'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_4",$days_later_followup_4);
			$hours_later = 24 * $days_later_followup_4;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "7") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
				
				
				/// START: send 4th email # 8 /////////////////////////////////////////
				$email_subject = "Improve Your Daily Cash Flow!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = '<b>Greetings!</b>

Did you know that to get paid using PAYYAP, all you need to do is enter your customer’s name, telephone number and amount owed; and PAYYAP will take care of the rest?! Yes, it\'s really that awesome!

But first we need you to configure & activate your PAYYAP account.

<u>It\'s super easy, quick and free!</u>

Simply open the PAYYAP app on your mobile device and <b>"Select Your Account" to <i>Configure & Activate.</i></b>

You will then be instructed to provide basic (but important) information, about yourself and your business.

What are you waiting for?

Activate your account today, and <b>let PAYYAP help you grow your business by improving your daily cash flow!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your choosing PAYYAP - The Payments App.</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
			
					
					
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '8'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
				
			}		

		}
	
	}
		



	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	### CONFIGURED BUT NO SS#
	
	/*
		
	$active_account_tranactions = false;
	$tmp_sql = "SELECT transactionid FROM transactions 
				WHERE accountid = '". $tmp_account_details['accountid'] ."'
				AND accountid != ''
				AND accountid != '0'
				AND accountid IS NOT NULL
				AND description = 'INCOMING' 
				AND status = 'APPROVED'
				;";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$active_account_tranactions = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("active_account_tranactions",$active_account_tranactions);
	
	
	if($test_logging == true) logger3("registered_member_verified_emailaddress",$registered_member_verified_emailaddress);	
	if($test_logging == true) logger3("account_activation_submitted",$account_activation_submitted);
	if($test_logging == true) logger3("11_account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
	
	$tmp_sql = "SELECT firstname FROM members WHERE memberid = '".  $tmp_account_details['creator_memberid'] ."';";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$FirstName = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("FirstName",$FirstName);
	*/
	
	
	
	
	$FirstName = $tmp_member_details['firstname'];
	
	
	if($FirstName) {
		$greetings_string = "<b>Dear ". $FirstName .",</b>";
	} else {
		$greetings_string = "<b>Greetings!</b>";
	}
	
	
	
	
	$account_part_2_completed = false;
	if($tmp_member_details['social_security_number']) {
		$account_part_2_completed = true;
	}
	
	
	

	
	
	if( 
		($registered_member_verified_emailaddress)
		&& ($account_part_1_completed)
		&& ($account_followup_status_details->followup_email_ID_last_sent <= 12)
	) {
		
	
		
		/// check if any transactions yet ?:
		
	
		
		
		if($account_part_2_completed == false) {
		
			 
			///send up to 4 emails:
			
			
			
			
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_1",$days_later_followup_1);
			$hours_later = 24 * $days_later_followup_1;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent <= "8") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
		
				/// START: send first email # 9 /////////////////////////////////////////
				$email_subject = "You are well on your way!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '

Congratulations! You are well on your way!

<i>We can see that you have Configured Your Profile, but have not yet finished providing all of the information required for your PAYYAP Account to be Activated.</i> Do you want to finish now? It\'s quick and easy!

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP2/4 ("Personal Identity").</b>

Fill-in the required fields, associated with your "Personal Identity"...

Please note: Your Personal Social Security Number is required <u>only for the purpose of Identity Validation.</u>

When you are finished, simply click the green button that says: <i>SAVE and Continue...</i>

You will then be presented with STEP 3/4 ("Business Identity").

Again, fill-in the required fields; this time, associated with your "Business Identity"... And when you are finished, click the green button that says: 
<i>SAVE and Continue...</ i>

<b>Your Activated and LIVE PAYYAP Account is just moments away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your choosing PAYYAP - The Payments App.</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '9'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}	
			
		
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_2",$days_later_followup_2);
			$hours_later = 24 * $days_later_followup_2;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "9") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
				
				
				
				/// START: send 2nd email #10 /////////////////////////////////////////
				$email_subject = "Don't panic! It is actually kind of fun!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '

Do you need a little help?
<i>We can see that you have Configured Your Profile, but have not yet finished providing all of the information required for your PAYYAP Account to be Activated.</i> Don\'t panic! It is actually kind of fun! :)

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP2/4 ("Personal Identity").</b>

Fill-in the required fields, associated with your "Personal Identity"...

Please note: Your Personal Social Security Number is required <u>only for the purpose of Identity Validation.</u>

Also please keep in mind that PAYYAP is a:

• 100% secure,

• PCI Compliant,

• Security-Metrics Validated,

• Payments Service Provider.

<b>All Account Information is held with the utmost security, privacy and respect.</b>

When you are finished, simply click the green button that says: <i>SAVE and Continue...</i>

You will then be presented with STEP 3/4 ("Business Identity").

Again, fill-in the required fields, this time, associated with your "Business Identity"... And when you are finished, click the green button that says: <i>SAVE and Continue...</ i>

<b>Your Activated and LIVE PAYYAP Account is just moments away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your choosing PAYYAP - The Payments App.</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '10'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_3",$days_later_followup_3);
			$hours_later = 24 * $days_later_followup_3;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "10") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 3rd email # 11 /////////////////////////////////////////
				$email_subject = "Don't be shy!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '
				
We understand that providing personal information (especially as it relates to your identity), can be a little intimidating!

Rest assured, PAYYAP securely holds your personal information with the utmost privacy and respect.

<i>We invite you to continue with your Account Configuration process...</i>

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP2/4 ("Personal Identity").</b>

Fill-in the required fields, associated with your "Personal Identity"...

When you are finished, simply click the green button that says: <i>SAVE and Continue...</i>

You will then be presented with STEP 3/4 ("Business Identity").

Again, fill-in the required fields, this time, associated with your "Business Identity"...

And when you are finished, click the green button that says: <i>SAVE and Continue...</ i>

<b>Your Activated and LIVE PAYYAP Account is just moments away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your choosing PAYYAP - The Payments App.</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '11'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_4",$days_later_followup_4);
			$hours_later = 24 * $days_later_followup_4;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "11") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 4th email /////////////////////////////////////////
				
				$email_subject = "We are here to help you";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '
				
How are you coming along with your PAYYAP Account Configuration?

<i>We can see that you have Configured Your Profile, but have not yet finished providing all of the information required for your PAYYAP Account to be Activated.</i> It\'s actually not as hard as you might imagine...

Go ahead and try it now!

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP2/4 ("Personal Identity").</b>

Fill-in the required fields, associated with your "Personal Identity"...

Please note: Your Personal Social Security Number is required <u>only for the purpose of Identity Validation.</u>

Also please keep in mind that PAYYAP is a:

• 100% secure,

• PCI Compliant,

• Security-Metrics Validated,

• Payments Service Provider.

<b>All Account Information is held with the utmost security, privacy and respect.</b>

When you are finished, simply click the green button that says: <i>SAVE and Continue...</i>

You will then be presented with STEP 3/4 ("Business Identity").

Again, fill-in the required fields, this time, associated with your "Business Identity"... And when you are finished, click the green button that says: <i>SAVE and Continue...</ i>

<b>Your Activated and LIVE PAYYAP Account is just moments away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your choosing PAYYAP - The Payments App.</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>			
				
				';
				
				
				
				/// END: send first email /////////////////////////////////////////
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '12'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
				
			}		

		}
	
	}



	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	### SS# BUT NO TAX ID
	
	/*
		
	$active_account_tranactions = false;
	$tmp_sql = "SELECT transactionid FROM transactions 
				WHERE accountid = '". $tmp_account_details['accountid'] ."'
				AND accountid != ''
				AND accountid != '0'
				AND accountid IS NOT NULL
				AND description = 'INCOMING' 
				AND status = 'APPROVED'
				;";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$active_account_tranactions = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("active_account_tranactions",$active_account_tranactions);
	
	
	if($test_logging == true) logger3("registered_member_verified_emailaddress",$registered_member_verified_emailaddress);	
	if($test_logging == true) logger3("account_activation_submitted",$account_activation_submitted);
	if($test_logging == true) logger3("11_account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
	
	$tmp_sql = "SELECT firstname FROM members WHERE memberid = '".  $tmp_account_details['creator_memberid'] ."';";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$FirstName = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("FirstName",$FirstName);
	*/
	

	
	
	$account_part_3_completed = false;
	if($tmp_account_details['tax_id']) {
		$account_part_3_completed = true;
	}
	
	
	

	
	
	if( 
		($registered_member_verified_emailaddress)
		&& ($account_part_1_completed)
		&& ($account_part_2_completed)
		&& ($account_followup_status_details->followup_email_ID_last_sent <= 16)
	) {
		
	
		
		/// check if any transactions yet ?:
		
	
		
		
		if($account_part_3_completed == false) {
		
		
			/// send up to 4 emails...
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_1",$days_later_followup_1);
			$hours_later = 24 * $days_later_followup_1;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent <= "12") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
		
				/// START: send first email # 9 /////////////////////////////////////////
				$email_subject = "Getting your EIN is super easy!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '

You are doing great!

<b>We can see that you are at the stage in the Account Configuration process where you are being asked to provide your Business Tax ID; also known as an EIN.</b>

If you are like many other PAYYAP users, a Business Tax (EIN) ID is not something you have, nor are familiar with!

Not to worry! Getting your EIN is super easy!

<i>In fact, our in-app Account Configuration process provides an option that authorizes PAYYAP (as a third party) to safely and securely apply for an EIN on your behalf. How easy is that?</i>

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP3/4 ("Business Identity").</b>

Fill-in the required fields, associated with your "Business Identity"...

At the end you will see a "pull-down-menu" where you can select your <i>Business Type.</i>

If you Do Not Have a Registered Company (no EIN, yet) then simply "select" that option (no EIN, yet).

That\'s it!

A check-box will appear -- indicating that you would like PAYYAP to safely and securely apply for an EIN on your behalf.

You can then click <i>SAVE and Continue...</i>

For additional information, regarding the Business Tax (EIN) ID (<u>including instructions on how to apply for an EIN yourself</u>), please visit our EIN FAQ.

As always, if you have any further questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the General FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you are going to have great success with PAYYAP!</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '13'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}	
			
		
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_2",$days_later_followup_2);
			$hours_later = 24 * $days_later_followup_2;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "13") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
				
				
				
				/// START: send 2nd email #10 /////////////////////////////////////////
				$email_subject = "We are here to help you";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '

How are you coming along with your PAYYAP Account Configuration?

<b>We can see that you are at the stage in the Account Configuration process where you are being asked to provide your Business Tax ID; also known as an EIN.</b>

If you are like many other PAYYAP users, a Business Tax (EIN) ID is not something you have!

Not to worry! We are here to help you!

<i>In fact, our in-app Account Configuration process provides an option that authorizes PAYYAP (as a third party) to safely and securely apply for an EIN on your behalf. How easy is that?</i>

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP3/4 ("Business Identity").</b>

Fill-in the required fields, associated with your "Business Identity"...

At the end you will see a "pull-down-menu" where you can select your <i>Business Type.</i>

If you Do Not Have a Registered Company (no EIN, yet) then simply "select" that option (no EIN, yet).

That\'s it!

A check-box will appear -- indicating that you would like PAYYAP to safely and securely apply for an EIN on your behalf.

<i>If you would prefer to apply for an EIN yourself, simply “un-check” the box.</i>

And be sure to please visit our EIN FAQ for more information.

As always, if you have any further questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the General FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you are going to have great success with PAYYAP!</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '14'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_3",$days_later_followup_3);
			$hours_later = 24 * $days_later_followup_3;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "14") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 3rd email # 11 /////////////////////////////////////////
				$email_subject = "Why stop now!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '
				
Your Activated and LIVE PAYYAP Account is just moments away!

<b>We can see that you are at the stage in the Account Configuration process where you are being asked to provide your Business Tax ID; also known as an EIN.</b>

Why Stop now? Getting your EIN is super easy!

<i>In fact, our in-app Account Configuration process provides an option that authorizes PAYYAP (as a third party) to safely and securely apply for an EIN on your behalf. How easy is that?</i>

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP3/4 ("Business Identity").</b>

Fill-in the required fields, associated with your "Business Identity"...

At the end you will see a "pull-down-menu" where you can select your <i>Business Type.</i>

If you Do Not Have a Registered Company (no EIN, yet) then simply "select" that option (no EIN, yet).

That\'s it!

A check-box will appear -- indicating that you would like PAYYAP to safely and securely apply for an EIN on your behalf.

You can then click <i>SAVE and Continue...</i>

For additional information, regarding the Business Tax (EIN) ID (<u>including instructions on how to apply for an EIN yourself</u>), please visit our EIN FAQ.

As always, if you have any further questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the General FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you are going to have great success with PAYYAP!</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '15'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_4",$days_later_followup_4);
			$hours_later = 24 * $days_later_followup_4;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "15") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 4th email /////////////////////////////////////////
				
				$email_subject = "Are you stuck?";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '
				
How are you coming along with your PAYYAP Account Configuration?

<b>We have a feeling you might be stuck at the part where you are being asked to provide your Business Tax ID; also known as an EIN.</b>

If you are like many other PAYYAP users, a Business Tax (EIN) ID is not something you have, nor are familiar with!

The most common question is: <b>Why do I need an EIN (Employment Identification Number) to use PAYYAP?</b>

The answer is simple:

Our banking partner (ProPay INC) requires (and needs to record) your EIN in order to facilitate all Credit Card and Debit Card "business" payments, on your behalf -- (whether you have employees or not).

The second most common question is: <b>How do I get an EIN?</b>

The answer again, is simple:

<i>In fact, our in-app Account Configuration process provides an option that authorizes PAYYAP (as a third party) to safely and securely apply for an EIN on your behalf. How easy is that?</i>

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP3/4 ("Business Identity").</b>

Fill-in the required fields, associated with your "Business Identity"...

At the end you will see a "pull-down-menu" where you can select your <i>Business Type.</i>

If you Do Not Have a Registered Company (no EIN, yet) then simply "select" that option (no EIN, yet).

That\'s it!

A check-box will appear -- indicating that you would like PAYYAP to safely and securely apply for an EIN on your behalf.

You can then click <i>SAVE and Continue...</i>

For additional information, regarding the Business Tax (EIN) ID (<u>including instructions on how to apply for an EIN yourself</u>), please visit our EIN FAQ.

As always, if you have any further questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the General FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you are going to have great success with PAYYAP!</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>			
				
				';
				
				
				
				/// END: send first email /////////////////////////////////////////
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '16'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
				
			}		

		}
	
	}







	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	### TAX ID BUT... 
	### NO PERSONAL ID 
	### NO BUSINESS ID
	
	/*
		
	$active_account_tranactions = false;
	$tmp_sql = "SELECT transactionid FROM transactions 
				WHERE accountid = '". $tmp_account_details['accountid'] ."'
				AND accountid != ''
				AND accountid != '0'
				AND accountid IS NOT NULL
				AND description = 'INCOMING' 
				AND status = 'APPROVED'
				;";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$active_account_tranactions = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("active_account_tranactions",$active_account_tranactions);
	
	
	if($test_logging == true) logger3("registered_member_verified_emailaddress",$registered_member_verified_emailaddress);	
	if($test_logging == true) logger3("account_activation_submitted",$account_activation_submitted);
	if($test_logging == true) logger3("11_account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
	
	$tmp_sql = "SELECT firstname FROM members WHERE memberid = '".  $tmp_account_details['creator_memberid'] ."';";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$FirstName = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("FirstName",$FirstName);
	*/
	

	
	
	/// show we need both emails
	$account_part_4_completed = false;
	if(
		($tmp_member_details['current']['identity']['photo_id_filename'])
		&& ($tmp_account_details['current']['identity']['photo_id_filename'])
	) {
		$account_part_4_completed = true;
	}
	
	
	

	
	
	if( 
		($registered_member_verified_emailaddress)
		&& ($account_part_1_completed)
		&& ($account_part_2_completed)
		&& ($account_part_3_completed)
		&& ($account_followup_status_details->followup_email_ID_last_sent <= 20)
	) {
		
		/// check if any transactions yet ?
		
		if($account_part_4_completed == false) {
		
			 
			///send up to 4 emails:
			
			
			
			
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_1",$days_later_followup_1);
			$hours_later = 24 * $days_later_followup_1;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent <= "16") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
		
				/// START: send first email # 9 /////////////////////////////////////////
				$email_subject = "You are one click away!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '

Well done!

You are doing a great job providing the information needed for your PAYYAP Account to be activated!

<i>We can see that you are in the final step -- but have not yet uploaded your "Proof of Identity".</i>

Do you want to do it now? It\'s quick and easy!

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP4/4 ("Proof of Identity").</b>

Underneath the first heading: <i>"Personal Identity Upload (from photo, scan or file)"</i>

Click on the "pull-down-menu" and from the 4 options, select the one that suits you best:

1. <b>Driver\'s License</b> (where your name is visible)

2. <b>Government Issued ID</b> (where your name is visible) 3. <b>Passport</b> (where your name is visible)

4. <b>Bank Statement</b> (where your name is visible)

Then use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

<u>TO BE CLEAR:</u> You can either "Take a Photo" of your Proof of Identity <u>OR</u> upload a file/scan/or photo (of your Proof of Identity) already "in" your mobile device gallery/ storage.

Next scroll down to the second heading: <i>"Business Identity Upload (from photo, scan or file)"</i>

Click on the "pull-down-menu" and from the 3 options, select the one that suits you best: 1. <b>Business Bank Statement</b> (business name visible)

2. <b>EIN Confirmation Receipt</b> (SS-4 Form)

3. <b>Business Tax Return</b> (business name name visible)

Again, use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

Once both uploads are complete, you can click <i>SAVE and Confirm to ACTIVATE</i> <b>Your Activated and LIVE PAYYAP Account is just one click away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your continued interest in PAYYAP - The Payments App.</b> 

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '17'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}	
			
		
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_2",$days_later_followup_2);
			$hours_later = 24 * $days_later_followup_2;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "17") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
				
				
				
				/// START: send 2nd email #10 /////////////////////////////////////////
				$email_subject = "The hard part is over!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '

You are doing great!

<i>We can see that you are in the final step -- but have not yet uploaded your "Proof of Identity".</i>

Don\'t worry! The hard part is over!

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP4/4 ("Proof of Identity").</b>

Underneath the heading: <i>"Personal Identity Upload (from photo, scan or file)"</i> Click on the "pull-down-menu" and from the 4 options, select the one that suits you best:

1. <b>Driver\'s License</b> (where your name is visible)

2. <b>Government Issued ID</b> (where your name is visible) 3. <b>Passport</b> (where your name is visible)

4. <b>Bank Statement</b> (where your name is visible)

Then use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

<u>TO BE CLEAR:</u> You can either "Take a Photo" of your Proof of Identity <u>OR</u> upload a file/scan/or photo (of your Proof of Identity) already "in" your mobile device gallery/ storage.

Next scroll down to the second heading: <i>"Business Identity Upload (from photo, scan or file)"</i>

Click on the "pull-down-menu" and from the 3 options, select the one that suits you best: 1. <b>Business Bank Statement</b> (business name visible)

2. <b>EIN Confirmation Receipt</b> (SS-4 Form)

3. <b>Business Tax Return</b> (business name name visible)

Again, use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

Once both uploads are complete, you can click <i>SAVE and Confirm to ACTIVATE</i> <b>Your Activated and LIVE PAYYAP Account is just one click away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you will have great success with PAYYAP - The Payments App.</b> 

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '18'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_3",$days_later_followup_3);
			$hours_later = 24 * $days_later_followup_3;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "18") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 3rd email # 11 /////////////////////////////////////////
				$email_subject = "Need a little help?";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '
				
How are you coming along with your PAYYAP Account Configuration?

<b>We can see that you are in the final step -- but have not yet uploaded your "Proof of Identity".</b>

It\'s actually not as hard as you might imagine...

We\'re here to help you!

<i>We can see that you are in the final step -- but have not yet uploaded your "Proof of Identity".</i>

Don\'t worry! The hard part is over!

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP4/4 ("Proof of Identity").</b>

Underneath the heading: <i>"Personal Identity Upload (from photo, scan or file)"</i>

Click on the "pull-down-menu" and from the 4 options, select the one that suits you best:

1. <b>Driver\'s License</b> (where your name is visible)

2. <b>Government IssuedID</b> (where your name is visible) 

3. <b>Passport</b> (where your name is visible)

4. <b>Bank Statement</b> (where your name is visible)

Then use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

<u>TO BE CLEAR:</u> You can either "Take a Photo" of your Proof of Identity <u>OR</u> upload a file/scan/or photo (of your Proof of Identity) already "in" your mobile device gallery/storage.

Next scroll down to the second heading: <i>"Business Identity Upload (from photo, scan or file)"</i> Click on the "pull-down-menu" and from the 3 options, select the one that suits you best:

1. <b>Business Bank Statement</b> (business name visible) 

2. <b>EIN Confirmation Receipt</b> (SS-4 Form)

3. <b>Business Tax Return</b> (business name visible)

Again, use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

Once both uploads are complete, you can click <i>SAVE and Confirm to ACTIVATE</i>

<b>Your Activated and LIVE PAYYAP Account is just one click away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff. Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you will have great success with PAYYAP - The Payments App.</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '19'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_4",$days_later_followup_4);
			$hours_later = 24 * $days_later_followup_4;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "19") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 4th email /////////////////////////////////////////
				
				$email_subject = "You can do it!!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '
				
We understand that providing information (especially as it relates to your identity), can be a little intimidating!

Rest assured PAYYAP is a one-hundred-percent secure, PCI Compliant and Security-Metrics Validated, Payments Service Provider. And all Account Information is held with the utmost security, privacy and respect.

<i>We invite you to go ahead and finish your Account Configuration! We know you can do it!</i> Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP4/4 ("Proof of Identity").</b>

Underneath the heading: <i>"Personal Identity Upload (from photo, scan or file)"</i>

Click on the "pull-down-menu" and from the 4 options, select the one that suits you best:

1. <b>Driver\'s License</b>(where your name is visible)

2. <b>Government Issued ID</b>(where your name is visible) 

3. <b>Passport</b>(where your name is visible)

4. <b>Bank Statement</b>(where your name is visible)

Then use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

<u>TO BE CLEAR:</u> You can either "Take a Photo" of your Proof of Identity <u>OR</u> upload a file/scan/or photo (of your Proof of Identity) already "in" your mobile device gallery/storage.

Next scroll down to the second heading: <i>"Business Identity Upload (from photo, scan or file)"</i> Click on the "pull-down-menu" and from the 3 options, select the one that suits you best:

1. <b>Business Bank Statement</b>(business name visible) 

2. <b>EINConfirmationReceipt</b>(SS-4Form)

3. <b>Business Tax Return</b>(business name visible)

Again, use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

Once both uploads are complete, you can click <i>SAVE and Confirm to ACTIVATE</i>

And that\'s it! You did it!

<b>Your Activated and LIVE PAYYAP Account is just one click away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff. Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you will have great success with PAYYAP - The Payments App.</b>

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>			
				
				';
				
				
				
				/// END: send first email /////////////////////////////////////////
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '20'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
				
			}		

		}
	
	}





	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	### BUSINESS ID BUT STILL NO PERSONAL ID
	
	
	/*
		
	$active_account_tranactions = false;
	$tmp_sql = "SELECT transactionid FROM transactions 
				WHERE accountid = '". $tmp_account_details['accountid'] ."'
				AND accountid != ''
				AND accountid != '0'
				AND accountid IS NOT NULL
				AND description = 'INCOMING' 
				AND status = 'APPROVED'
				;";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$active_account_tranactions = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("active_account_tranactions",$active_account_tranactions);
	
	
	if($test_logging == true) logger3("registered_member_verified_emailaddress",$registered_member_verified_emailaddress);	
	if($test_logging == true) logger3("account_activation_submitted",$account_activation_submitted);
	if($test_logging == true) logger3("11_account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
	
	$tmp_sql = "SELECT firstname FROM members WHERE memberid = '".  $tmp_account_details['creator_memberid'] ."';";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$FirstName = getTHECASHIER($tmp_sql);
	if($test_logging == true) logger3("FirstName",$FirstName);
	*/
		
	
	$account_part_5_completed = false;
	if(
		($tmp_member_details['current']['identity']['photo_id_filename'])
	) {
		$account_part_5_completed = true;
	}
	
	
	

	
	
	if( 
		($registered_member_verified_emailaddress)
		&& ($account_part_1_completed)
		&& ($account_part_2_completed)
		&& ($account_part_3_completed)
		&& ($account_part_4_completed)
		&& ($account_followup_status_details->followup_email_ID_last_sent <= 24)
	) {
		
	
		
		/// check if any transactions yet ?:
		
	
		
		
		if($account_part_5_completed == false) {
		
			 
			///send up to 4 emails:
			
			
			
			
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_1",$days_later_followup_1);
			$hours_later = 24 * $days_later_followup_1;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent <= "20") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
		
				/// START: send first email # 9 /////////////////////////////////////////
				$email_subject = "You are one click away!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '

Well done!

You are doing a great job providing the information needed for your PAYYAP Account to be activated!

<i>We can see that you are in the final step -- but have not yet uploaded your "Proof of Identity".</i>

Do you want to do it now? It\'s quick and easy!

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP4/4 ("Proof of Identity").</b>

Underneath the heading: <i>"Personal Identity Upload (from photo, scan or file)"</i> Click on the "pull-down-menu" and from the 4 options, select the one that suits you best:

1. <b>Driver\'s License</b> (where your name is visible)

2. <b>Government Issued ID</b> (where your name is visible) 

3. <b>Passport</b> (where your name is visible)

4. <b>Bank Statement</b> (where your name is visible)

Then use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

<u>TO BE CLEAR:</u> You can either "Take a Photo" of your Proof of Identity <u>OR</ u> upload a file/scan/or photo (of your Proof of Identity) already "in" your mobile device gallery/storage.

Once the upload is complete, you can click <i>SAVE and Confirm to ACTIVATE</i> <b>Your Activated and LIVE PAYYAP Account is just one click away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>Thank you for your continued interest in PAYYAP - The Payments App.</b> 

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '21'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}	
			
		
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_2",$days_later_followup_2);
			$hours_later = 24 * $days_later_followup_2;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "21") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				
				
				
				
				
				/// START: send 2nd email #10 /////////////////////////////////////////
				$email_subject = "The hard part is over!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '

You are doing great!

<i>We can see that you are in the final step -- but have not yet uploaded your "Proof of Identity".</i>

Don\'t worry! The hard part is over!

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP4/4 ("Proof of Identity").</b>

Underneath the heading: <i>"Personal Identity Upload (from photo, scan or file)"</i> Click on the "pull-down-menu" and from the 4 options, select the one that suits you best:

1. <b>Driver\'s License</b> (where your name is visible)

2. <b>Government Issued ID</b> (where your name is visible) 

3. <b>Passport</b> (where your name is visible)

4. <b>Bank Statement</b> (where your name is visible)

Then use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

<u>TO BE CLEAR:</u> You can either "Take a Photo" of your Proof of Identity <u>OR</ u> upload a file/scan/or photo (of your Proof of Identity) already "in" your mobile device gallery/storage.

Once the upload is complete, you can click <i>SAVE and Confirm to ACTIVATE</i> <b>Your Activated and LIVE PAYYAP Account is just one click away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you will have great success with PAYYAP - The Payments App.</b> 

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '22'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_3",$days_later_followup_3);
			$hours_later = 24 * $days_later_followup_3;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "22") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 3rd email # 11 /////////////////////////////////////////
				$email_subject = "Need a little help?";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '
				
How are you coming along with your PAYYAP Account Configuration?

<b>We can see that you are in the final step -- but have not yet uploaded your "Proof of Identity".</b>

It\'s actually not as hard as you might imagine...

We\'re here to help you!

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP4/4 ("Proof of Identity").</b>

Underneath the heading: <i>"Personal Identity Upload (from photo, scan or file)"</i> Click on the "pull-down-menu" and from the 4 options, select the one that suits you best:

1. <b>Driver\'s License</b> (where your name is visible)

2. <b>Government Issued ID</b> (where your name is visible) 

3. <b>Passport</b> (where your name is visible)

4. <b>Bank Statement</b> (where your name is visible)

Then use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

<u>TO BE CLEAR:</u> You can either "Take a Photo" of your Proof of Identity <u>OR</ u> upload a file/scan/or photo (of your Proof of Identity) already "in" your mobile device gallery/storage.

Once the upload is complete, you can click <i>SAVE and Confirm to ACTIVATE</i> <b>Your Activated and LIVE PAYYAP Account is just one click away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you will have great success with PAYYAP - The Payments App.</b> 

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>
				
				
				';
				
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '23'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			
			if($test_logging == true) logger3("days_later_followup_4",$days_later_followup_4);
			$hours_later = 24 * $days_later_followup_4;
			if($test_logging == true) logger3("hours_later",$hours_later);
		
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			if($test_datetime_future) $current_datetime = $test_datetime_future;
			
			if($test_logging == true) logger3("test_datetime_future",$test_datetime_future);
			
			$last_updated_datetime = $account_followup_status_details->datetime_updated;
			if($test_logging == true) logger3("last_updated_datetime",$last_updated_datetime);
			
			
			$last_updated_time = strtotime($last_updated_datetime);
			if($test_logging == true) logger3("last_updated_time",$last_updated_time);
			
			
			$last_updated_time_to_test = strtotime("+ ". $hours_later ." hours",$last_updated_time);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_time_to_test);
			
			$last_updated_datetime_to_test = date("Y-m-d H:i:s",$last_updated_time_to_test);
			if($test_logging == true) logger3("last_updated_datetime_to_test",$last_updated_datetime_to_test);
			
			if($test_logging == true) logger3("(current_datetime > last_updated_datetime_to_test)","($current_datetime > $last_updated_datetime_to_test)");
			
			if($test_logging == true) logger3("account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
			
		
			
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($account_followup_status_details->followup_email_ID_last_sent == "23") 
				&& ($current_datetime > $last_updated_datetime_to_test) 
			) {
				
				
				
				/// START: send 4th email /////////////////////////////////////////
				
				$email_subject = "You can do it!!";
				if($test_logging == true) logger3("SETTING THE EMAIL!!!",$email_subject);
				
				$email_message = $greetings_string . '
				
We understand that providing information (especially as it relates to your identity), can be a little intimidating!

Rest assured PAYYAP is a one-hundred-percent secure, PCI Compliant and Security- Metrics Validated, Payments Service Provider. And all Account Information is held with the utmost security, privacy and respect.

<i>We invite you to go ahead and finish your Account Configuration! We know you can do it!</i>

Simply open the PAYYAP App on your mobile device, "Select Your Account" and navigate your way to <b>STEP4/4 ("Proof of Identity").</b>

Underneath the heading: <i>"Personal Identity Upload (from photo, scan or file)"</i> Click on the "pull-down-menu" and from the 4 options, select the one that suits you best:

1. <b>Driver\'s License</b> (where your name is visible)

2. <b>Government Issued ID</b> (where your name is visible) 

3. <b>Passport</b> (where your name is visible)

4. <b>Bank Statement</b> (where your name is visible)

Then use the built-in PAYYAP Camera/Uploader, to either:

• "Take a Photo" or

• "Upload a File".

<u>TO BE CLEAR:</u> You can either "Take a Photo" of your Proof of Identity <u>OR</ u> upload a file/scan/or photo (of your Proof of Identity) already "in" your mobile device gallery/storage.

Once the upload is complete, you can click <i>SAVE and Confirm to ACTIVATE</i>

And that\'s it! You did it!

<b>Your Activated and LIVE PAYYAP Account is just one click away!</b>

If you have any questions, please do not hesitate to contact our courteous customer support staff.

Or, visit the FAQs page at: <a href=\'https://support.payyap.network\' target=\'_PAYYAP_SUPPORT\'>https://support.PAYYAP.network</a>.

<b>We know you will have great success with PAYYAP - The Payments App.</b> 

Sincerely,

PAYYAP.network Support Staff

<a href=\'mailto:support@payyap.network?subject=I have a question about PAYYAP...\' target=\'_PAYYAP_HOMEPAGE\'>support@PAYYAP.network</a>
<a href=\'https://payyap.network\' target=\'_PAYYAP_HOMEPAGE\'>https://PAYYAP.network</a>			
				
				';
				
				
				
				/// END: send first email /////////////////////////////////////////
				$updated_datetime = datetime();
				$tmp_sql = "UPDATE followup_emails 
							SET followup_email_ID_last_sent = '24'
							,datetime_updated = '". $updated_datetime ."' 
							WHERE 
							followup_emails_id = '". $account_followup_status_details->followup_emails_id ."';";
				if($test_logging == true) logger3("tmp_sql",$tmp_sql);
				$update_results = updateTHECASHIER($tmp_sql);
				if($test_logging == true) logger3("update_results",$update_results);
				$updated_followup_email_ID_last_sent = true;
				
				
			}		

		}
	
	}





















	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	###################################################################################################
	### PROCESSING NOW....
	
	
	if($test_logging == true) logger3("15_account_followup_status_details->followup_email_ID_last_sent",$account_followup_status_details->followup_email_ID_last_sent);
/*  // if payment processing has begun:
	
	if( 
		($account_followup_status_details->followup_email_ID_last_sent <= 16)
	) {
		
		
		
		/// check if any transactions yet ?:
		
		$active_account_tranactions = false;
		$tmp_sql = "SELECT transactions....";
		$active_account_tranactions = getTHECASHIER($tmp_sql);
		
		
		if($active_account_tranactions) {
		
			 
			///send up to 4 emails:
			
			
			
			
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			$hours_later = 24 * $days_later_followup_1;
			$tmp_time = strtotime("-". $hours_later ." hours");
			$datetime_in_the_past = date("Y-m-d H:i:s",$tmp_time);
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($member_followup_status_details->followup_email_ID_last_sent <= "12") 
				&& ($datetime_in_the_past > $member_followup_status_details->datetime_updated) 
			) {
		
				/// START: send first email /////////////////////////////////////////
				
				$email_subject = "_XXXXX_";
				$email_message = `
				
				
				`;
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_followup_email_ID_last_sent = true;
				
			}	
			
		
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			$hours_later = 24 * $days_later_followup_2;
			$tmp_time = strtotime("-". $hours_later ." hours");
			$datetime_in_the_past = date("Y-m-d H:i:s",$tmp_time);
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($member_followup_status_details->followup_email_ID_last_sent == "13") 
				&& ($datetime_in_the_past > $member_followup_status_details->datetime_updated) 
			) {
				
				
				
				/// START: send 2nd email /////////////////////////////////////////
				
				$email_subject = "_XXXXX_";
				$email_message = `
				
				
				`;
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			$hours_later = 24 * $days_later_followup_3;
			$tmp_time = strtotime("-". $hours_later ." hours");
			$datetime_in_the_past = date("Y-m-d H:i:s",$tmp_time);
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($member_followup_status_details->followup_email_ID_last_sent == "14") 
				&& ($datetime_in_the_past > $member_followup_status_details->datetime_updated) 
			) {
				
				
				
				/// START: send 3rd email /////////////////////////////////////////
				
				$email_subject = "_XXXXX_";
				$email_message = `
				
				
				`;
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_followup_email_ID_last_sent = true;
				
			}
			
			
			/// now figure out which email to send:
			$tmp_time = "";
			$hours_later = "";
			$tmp_datetime = "";
			$hours_later = 24 * $days_later_followup_4;
			$tmp_time = strtotime("-". $hours_later ." hours");
			$datetime_in_the_past = date("Y-m-d H:i:s",$tmp_time);
			if(
				($updated_followup_email_ID_last_sent == false)
				&& ($member_followup_status_details->followup_email_ID_last_sent == "15") 
				&& ($datetime_in_the_past > $member_followup_status_details->datetime_updated) 
			) {
				
				
				
				/// START: send 4th email /////////////////////////////////////////
				
				$email_subject = "_XXXXX_";
				$email_message = `
				
				
				`;
				
				
				
				/// END: send first email /////////////////////////////////////////
				
				$updated_followup_email_ID_last_sent = true;
				
			}		

		}
	
	}

*/ // end after processing has begun


	
	$to = $send_the_followup_to_this_emailaddress;
	
	
	
	

	### ADD UNSUBSCRIBE:
	$message .= "
		
		<hr><span style='font-size:14px;'><a href='https://UNSUBSCRIBE.payyap.network/?emailaddress=". $to ."' target='_PAYYAP_UNSUBSCRIBE' >Click here to UNSUBSCRIBE<a/> from these PAYYAP hints & reminders.</span>
		
		";




	if($test_logging == true) logger3("to",$to);
	if($test_logging == true) logger3("email_subject",$email_subject);
	if($test_logging == true) logger3("email_message",$email_message);
	
	
	//exit;
	### TEST FOR UNSUBSCRIBE: (could be placed before all the calculations to save CPU)
	
	$unsubscribed = false;
	$tmp_sql = "SELECT emailaddress FROM unsubscribe WHERE emailaddress = '". $to ."';";
	if($test_logging == true) logger3("tmp_sql",$tmp_sql);
	$unsubscribed = getTHECASHIER($tmp_sql,"ad_campaigns");
	if($test_logging == true) logger3("is_unsubscribed",$is_unsubscribedto);
	
	
	
	
	### SEND THE EMAIL:
	if(
		($to)
		&& ($email_subject)
		&& ($email_message)
		&& (!$unsubscribed)
		
	) {
		if($test_emailing == true) logger3("SENDING EMAIL...","");
		
		if($test_emailing == true) logger3("to",$to);
		if($test_emailing == true) logger3("email_subject",$email_subject);
		
		quick_mailer($to,$email_subject,$email_message);
	}
	
	
	
	
	if($test_logging == true) logger3("END ONE ACCOUNT CYCLE","");
	//exit;
	
	
		
	
}





if($test_logging == true) logger3("10 end",$x);





### END: SESSIONS & STUFF.
#
#
#
include($_SESSION['template']['company']['file_path'] . "shared/end_verified_session.shared");

?>