/
classes.php
2105 lines (1360 loc) · 40.7 KB
/
classes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
class EmailArt{
public function getemails($id)
{
global $wpdb;
$checkdb = $wpdb->get_row(
"SELECT * FROM ".$wpdb->prefix . 'db_details where id ='.$id
);
$host = $checkdb->db_host;
$database = $checkdb->db_name;
$user = $checkdb->db_user;
$password = $checkdb->db_password;
$prefix = $checkdb->db_prefix;
$connect = mysql_connect($host, $user , $password );
if(!$connect)
{
echo '<span class="unsuccess">Conection Error ! Please check Server Host and Credentials.</span>';
die();
}
$db = mysql_select_db($database);
if(!$db)
{ echo '<span class="unsuccess">Cannot access Database, Please check database name or authorized user for this database.</span>';
die();
}
$query = mysql_query('select user_login, user_email from '.$prefix.'users');
while($fetch = mysql_fetch_row($query))
{
$email = $fetch[1];
$name = $fetch[0];
$db_id = $id;
$check = $wpdb->get_results(
"SELECT * FROM ".$wpdb->prefix . 'ea_emails where email="'.$email.'"'
);
if($wpdb->num_rows < 1)
{
echo '<span class="success"><b> '.$email.'</b> has been added.</span>';
echo '<br>';
$wpdb->insert(
$wpdb->prefix . 'ea_emails',
array(
'name' => $name,
'email' => $email,
'site_id' => $db_id
)
);
}
else
{
echo '<span class="unsuccess"><b> '.$email.'</b> has been skipped. <br> Reason: Already in Database </span>';
echo '<br>';
}
}
}
public function save_db($host,$db,$user,$pass,$prefix,$db_id){
global $wpdb;
$connect = mysql_connect($host, $user , $pass );
if(!$connect)
{
echo '<span class="unsuccess">Conection Error ! Please check Server Host and Credentials.</span>';
die();
}
$database = mysql_select_db($db);
if(!$database)
{ echo '<span class="unsuccess">Cannot access Database, Please check database name or authorized user for this database.</span>';
die();
}
$database_query = mysql_query('SELECT option_value
FROM '.$prefix.'options
WHERE option_name IN ("siteurl","blogname")
');
$i = 0;
while($fetch_db = mysql_fetch_row($database_query))
{
$i = $i +1 ;
if($i == 1 )
{
$db_blogname = $fetch_db[0];
}
if($i == 2 )
{
$db_siteurl = $fetch_db[0];
}
}
$check_db = $wpdb->get_row(
"SELECT * FROM ".$wpdb->prefix . "db_details where id=".$db_id
);
if($wpdb->num_rows >0)
{
if($_GET['action'] == 'save_db')
{
$wpdb->update(
$wpdb->prefix . 'db_details',
array(
'site_name' => $db_blogname,
'site_url' => $db_siteurl,
'db_host' => $host,
'db_name' => $db,
'db_user' => $user,
'db_password' => $pass,
'db_prefix' => $prefix
),
array( 'id' => $_GET['db_id'] )
);
}
}
else
{
if($_GET['action'] == 'save_db')
{
$wpdb->insert(
$wpdb->prefix . 'db_details',
array(
'site_name' => $db_blogname,
'site_url' => $db_siteurl,
'db_host' => $host,
'db_name' => $db,
'db_user' => $user,
'db_password' => $pass,
'db_prefix' => $prefix
)
);
}
}
$_SESSION['msg'] = '<span class="success">Database credentials updated successfully.</span>';
}
public function trigger_emails(){
global $wpdb;
//GET CURRENT DATE AND TIME
$current_time = date("Y-m-d H:i:s");
//GET AMOUNTS OF EMAIL SENT IN LAST ACTIVITY, CHECK IF YOU HAVEN'T USED IT ALL
$prev_count = $this->getsetting('remain');
//GET TIME OF NEXT ACTIVITY WHICH IS BEEN SET IN 2ND LAST ACTIVITY AND ADD AN HOUR IN IT
$prev_time = date( "Y-M-d H:i:s", strtotime( $check_schedule->nexttime ) + (60*5) );
//IF LAST HOUR IS GONE RESET THE LIMIT TO ZERO
if ($current_time > $prev_time)
{
//RESET THE HOURLY LIMIT
$prev_count = 0;
$this->handleremain_email($prev_count);
}
//CHECK IF THERE IS ANY PENDING POST
$get_p_post = $wpdb->get_row(
"SELECT * FROM ".$wpdb->prefix . "ea_posts where done=0 ORDER BY id asc LIMIT 1"
);
if($wpdb->num_rows > 0)
{
//GET POST ID AND WP POST
$post_id = $get_p_post->post_id;
$id_post = $get_p_post->id;
$post = get_post( $post_id );
//CHECK IF USER WANTS A NOTIFICATION THEN SEND EMAIL TO HIM THAT TASK HAS INITIATED
$notify_switch = $this->getsetting('notify');
//CHECK IF ADMIN WANTS A NOTIFICATION
if($notify_switch == 1)
{
//SEND EMAIL TO ADMIN
$this->send_notifyadmin('initiate',$post_id,'','');
echo 'Email Sent - INITIATE';
}
//GET BIGGEST EMAIL ID INSTEAD OF CHECKING ALL ONE BY ONE
$max_email = $wpdb->get_var("SELECT max(email_id) as max_email FROM ".$wpdb->prefix . "ea_emails_history where post_id=".$id_post );
// MOVE FORWARD IF ANY POST IS PENDING TO SEND OUT
if(!empty($max_email)){
$get_emails = $wpdb->get_results( "SELECT id,email,name from ". $wpdb->prefix. "ea_emails where unsubscribe=0 and invalid_email=0 and id > ".$max_email );
}else
{
$get_emails = $wpdb->get_results( "SELECT id,email,name from ". $wpdb->prefix. "ea_emails where unsubscribe=0 and invalid_email=0 ");
}
$email_count = $prev_count;
foreach($get_emails as $get_email)
{
//FOR EACH LOOP STARTS TO SEND EMAIL ONE BY ONE
echo 'Entered FOR LOOP';
$email_id = $get_email->id;
$email_name = $get_email->name;
$email = $get_email->email;
$allowedmails = $this->getsetting('emailcount');
//CHECK IF YOU HAVE EMAILS LEFT IN YOUR HOURLY LIMIT YOU SET IN SETTINGS
if($email_count <= $allowedmails )
{
// GET Post author ID
$author = $post->post_author;
// GET AUTHOR NAME
$name = get_the_author_meta( 'display_name', $author );
// GET POST TITLE
$title = $post->post_title;
// GET POST PERMALINK
$permalink = get_permalink( $post->ID );
//SET SUBJECT FOR EMAIL
$subject = $email_name.' CHECK OUT NEW POST : "'.$title.'"';
//SET EMAIL BODY
$message = '
<h1 align="center">
'.get_bloginfo( 'name' ).'
</h1>
<h2>New Post Notification</h2>
<p style="font-size:14px; ">
Hey '.$email_name.',
<br>
I have posted a new article "'.$title.'" on my site <a href="'.get_bloginfo( 'siteurl' ).'">'.get_bloginfo( 'name' ).' </a></p>
<br>
<b>Check it out:</b>
<br>
<h2 align="center">
<a href="'.$permalink.'" style=" background:red; color:#FFF; border:1px solid #000; padding:"10px;> '.$title.'</a>
</h2>
<br>
<p align="center" style="font-size:12px;">Direct Link: '.$permalink.'</p>
<br>
<p style="font-size:14px;">For more information visit us at '.get_bloginfo( 'siteurl' ).' </p>
<br>
<br>
<p style="font-size:14px;">
-
<br>
Regards,
<br>
'.$name.'
</p>
<br>
<p align="center" style="font-size:10px;">
<a href="'.get_bloginfo( 'siteurl' ).'/unsubscribe-email-artillery?id='.$email_id.'&email='.$email.'"> Unsubscribe</a> from future Notifications</p> ' ;
//SET EMAIL HEADERS
$headers = "MIME-Version: 1.0\r\n
Content-Type: text/html; charset=ISO-8859-1\r\n";
//ADD EMAIL TO SEND EMAIL TO
$to = $email_name.' <'.$email.'>';
$email_count = $email_count + 1;
echo $email_count;
//SEND EMAIL NOW
wp_mail( $to, $subject, $message, $headers );
//UPDATE EMAIL HISTORY
$this->update_email_history($id_post , $email_id);
}//CHECK IF EMAIL LIMITS STILL LEFT : IF END
//BREAK THE FOREACH LOOP IF EMAIL LIMIT REACHED
if($email_count == $allowedmails )
{
break;
}
}//FOR EACH END
//CHECK IF THIS POST IS DONE SENDING BUT STILL HAVE REMAINING HOURLY LIMIT
if($email_count < $allowedmails )
{
//MARK THIS POST DONE
$this->mark_post_done($id_post);
//SET HOURLY LIMIT FOR NEXT SESSION IN SAME HOUR
$this->handleremain_email($email_count);
//CHECK IF NOTIFICATION IS SWITCHED ON IN SETTINGS
$notify_switch = $this->getsetting('notify');
if($notify_switch == 1)
{
// SEND EMAIL
$this->send_notifyadmin('markdone',$post_id,'',$email_count);
}
// RUN THE HOURLY ACTIVITY AGAIN AS WE STILL HAS THE LIMIT
// etmbu_send_emails_hourly();
}
//CHECK IF THE HOURLY LIMIT IS CONSUMED
if($email_count == $allowedmails )
{
//SET THE NEXT ACTIVITY TIME
$nexttime = date("Y-m-d H:i:s", strtotime("+5 minutes"));
$this->update_email_schedule($nexttime);
//CHECK IF ADMIN NOTIFICATIONS ARE ON IN SETTINGS
$notify_switch = $this->getsetting('notify');
if($notify_switch == 1)
{
//SEND EMAIL
$this->send_notifyadmin('nexttime',$post_id,$nexttime,$email_count);
}
$this->handleremain_email('0');
}
}//END PENDING POST EXIST IF
else
{
//NO PENIDING POSTS TO SEND OUT
//CHECK IF NOTIFICATIONS ARE ON IN SETTINGS
$notify_switch = $this->getsetting('notify');
//CHECK IF ADMIN WANTS A NOTIFICATION
if($notify_switch == 1)
{
//SEND EMAIL
$this->send_notifyadmin('nopending','','','');
}
}//END IF : NO PENDING POST EXIST
}
public function insert_post_id($postofid){
global $wpdb;
$check_schedule = $wpdb->get_row(
"SELECT * FROM ".$wpdb->prefix . "ea_posts where post_id=".$postofid
);
if($wpdb->num_rows <1)
{
$wpdb->insert(
$wpdb->prefix . 'ea_posts',
array(
'post_id' => $postofid
)
);
}
}
public function update_email_history($post_id, $email_id)
{
global $wpdb;
$wpdb->insert(
$wpdb->prefix . 'ea_emails_history',
array(
'post_id' => $post_id,
'email_id' => $email_id
)
);
}
public function update_email_schedule($nexttime){
global $wpdb;
$check_schedule = $wpdb->get_row(
"SELECT * FROM ".$wpdb->prefix . "ea_schedule_trigger where id =1"
);
if($wpdb->num_rows >0)
{
$wpdb->update(
$wpdb->prefix . 'ea_schedule_trigger',
array(
'nexttime' => $nexttime
),
array( 'id' => 1 )
);
}
else
{
$wpdb->insert(
$wpdb->prefix . 'ea_schedule_trigger',
array(
'id' => 1 ,
'nexttime' => $nexttime
)
);
}
$_SESSION['msg'] = '<span class="success">Database credentials updated successfully.</span>';
}
public function mark_post_done($post_id){
global $wpdb;
$wpdb->update(
$wpdb->prefix . 'ea_posts',
array(
'done' => 1
),
array( 'id' => $post_id )
);
}
public function getallsites(){
global $wpdb;
if($_GET['action'] == 'delete_db')
{
$wpdb->delete( $wpdb->prefix . "db_details", array( 'id' => $_REQUEST['db_id'] ) );
$wpdb->delete( $wpdb->prefix . "ea_emails", array( 'site_id' => $_REQUEST['db_id'] ) );
}
?>
<h1>All Sites</h1>
<hr />
<table>
<tr>
<th>Site Name</th><th>Users</th><th>Action</th>
</tr>
<tr>
<td><a href="#" >This Site & Imported Emails</a></td>
<td>
<?php
// users
$total_query = 'SELECT COUNT(1) FROM '.$wpdb->prefix.'ea_emails where site_id=0';
$total = $wpdb->get_var( $total_query );
echo $total;
?>
Users
</td>
<td>No Action Available</td>
</tr>
<?php
$details_db = $wpdb->get_results(
"SELECT * FROM ".$wpdb->prefix . 'db_details '
);
foreach($details_db as $detail_db)
{
$ea_site_name = $detail_db->site_name;
$ea_site_url = $detail_db->site_url;
$ea_site_id = $detail_db->id;
if(empty($ea_site_name))
{
$ea_site_name = '(no name)';
}
?>
<tr>
<td><a href="<?php echo $ea_site_url; ?>" target="new"><?php echo $ea_site_name; ?></a></td>
<td>
<?php
// users
$total_query = 'SELECT COUNT(1) FROM '.$wpdb->prefix.'ea_emails where site_id='.$ea_site_id;
$total = $wpdb->get_var( $total_query );
echo $total;
?>
Users
</td>
<td><a href="?page=etmbu-add-new-site&db_id=<?php echo $ea_site_id; ?>">Edit</a> | <a href="?page=etmbu-all-sites-settings&action=delete_db&db_id=<?php echo $ea_site_id; ?>" onclick="return delete_confirm();">Delete</a></td>
</tr>
<?php
}
?>
</table>
<?php
}
public function manual_sync_emails(){
global $wpdb;
?>
<h1>Sync Emails</h1>
<hr />
<table>
<form action="?page=etmbu-manual-email-sync&action=get_emails" method="post">
<tr>
<td>Choose Site</td>
<td>
<select name="db_id">
<!---
//EDITING
-->
<option>This Site</option>
<?php
$details_db = $wpdb->get_results(
"SELECT * FROM ".$wpdb->prefix . 'db_details '
);
foreach($details_db as $detail_db)
{
$ea_site_name = $detail_db->site_name;
$ea_site_id = $detail_db->id;
if(empty($ea_site_name))
{
$ea_site_name = '(no name)';
}
?>
<option value="<?php echo $ea_site_id; ?>"><?php echo $ea_site_name; ?> </option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Initiate Manual Sync </td>
<td><input type="hidden" value='1' name="submit_syncemails" ><input type="submit" value="Sync Emails" />
</tr>
</form>
</table>
<h4 align="center">Please Note: Do not close the window after initiating the Sync untill page finishes loading.</h4></td>
<?php
if($_GET['action'] == 'get_emails' && !empty($_POST['submit_syncemails']) )
{
echo '<h2>Please Wait..</h2>';
if($_POST['db_id'] == 001)
{
$this-getemails_thissite();
}
else
{
$db_id = $_POST['db_id'];
$this->getemails($db_id);
}
}
}
public function ea_update_setting(){
global $wpdb;
if($_GET['action'] == 'save_settings' && !empty($_POST['submit_settings']) )
{
$adminemail = $_POST['admin_email'];
$email_count = $_POST['email_count'];
$notify_switch = $_POST['notify_switch'];
$this->save_settings($adminemail, $email_count, $notify_switch );
}
$check_settings = $wpdb->get_row(
'SELECT * FROM '.$wpdb->prefix . 'ea_settings where id=1'
);
?>
<h1> General Settings</h1>
<hr />
<?php echo $_SESSION['msg']; $_SESSION['msg'] = ''; ?>
<form action="?page=etmbu-email-artillery&action=save_settings" method="post">
<table>
<tr>
<td>Admin Email</td>
<td><input type="text" name="admin_email" value="<?php echo $check_settings->admin_email; ?>" ><br />
</td>
</tr>
<tr>
<td>Emails Count<br />
<em>Emails to be sent out every 5 min</em>
</td>
<td><input type="text" name="email_count" value="<?php echo $check_settings->email_count; ?>" ></td>
</tr>
<tr>
<td>Notifications</td>
<td><select name="notify_switch">
<option value="0" <?php if( $check_settings->notify_switch == 0 ){ echo 'selected'; } ?> >Disable</option>
<option value="1" <?php if( $check_settings->notify_switch == 1 ){ echo 'selected'; } ?>>Enable</option>
</select></td>
</tr>
<tr>
<td><input type="hidden" value='1' name="submit_settings" ></td>
<td><input type="submit" value="Update Settings" ></td>
</table>
</form>
<?php
}
public function save_settings($adminemail, $email_count, $notify_switch ){
global $wpdb;
$check_db = $wpdb->get_row(
"SELECT * FROM ".$wpdb->prefix . "ea_settings where id=1"
);
if($wpdb->num_rows >0)
{
if($_GET['action'] == 'save_settings')
{
$wpdb->update(
$wpdb->prefix . 'ea_settings',
array(
'admin_email' => $adminemail,
'email_count' => $email_count,
'notify_switch' => $notify_switch
),
array( 'id' => 1 )
);
}
}
else
{
if($_GET['action'] == 'save_settings')
{
$wpdb->insert(
$wpdb->prefix . 'ea_settings',
array(
'id' => 1,
'admin_email' => $adminemail,
'email_count' => $email_count,
'notify_switch' => $notify_switch
)
);
}
}
$_SESSION['msg'] = '<span class="success">Settings updated successfully.</span>';
}
public function getsetting($arg){
global $wpdb;
$check_settings = $wpdb->get_row(
'SELECT * FROM '.$wpdb->prefix . 'ea_settings where id=1'
);
if($arg == 'adminemail')
{
$getarg = 'admin_email';
}
if($arg == 'emailcount')
{
$getarg = 'email_count';
}
if($arg == 'notify')
{
$getarg = 'notify_switch';
}
if($arg == 'remain')
{
$getarg = 'remaining_emails';
}
$valarg = $check_settings->$getarg;
return $valarg;
}
public function send_notifyadmin( $type , $post_id , $nexttime, $email_count){
global $wpdb;
if($type == 'markdone')
{
$post = get_post( $post_id );
$title = $post->post_title;
$permalink = get_permalink( $post_id );
$subject = 'Email Task Finished for Post "'.$title.'"';
$message = 'Hey Admin, <br>
<p>The task to send out emails about your post "<a href="'.$permalink.'">'.$title.'</a>" has just been completed. We have sent out emails to all the synced users in your databse. We will be looking for next task in upcoming 5 minutes.
</p>
<br>
<p>This Email has been sent automatically by "Email Artillery" wordpress plugin. To stop recieving notification emails follow the following steps:
<br>
1. Login to Wordpress Admin Panel (wp-admin)<br>
2. Go to Email Artillery<br>
3. Disable the "Notifications" in General Settings
</p>
<br>
<br>
<br>
Regards,
<br>
Email Artillery
';
}
if($type == 'nopending')
{
$subject = 'No Pending Post to send out : Email Artillery';
$message = 'Hey Admin, <br>
<p>There is no pending task to send out. We will be checking for any pending posts in the next 5 Min.
</p>
<br>
<p>This Email has been sent automatically by "Email Artillery" wordpress plugin. To stop recieving notification emails follow the following steps:
<br>
1. Login to Wordpress Admin Panel (wp-admin)<br>
2. Go to Email Artillery<br>
3. Disable the "Notifications" in General Settings
</p>
<br>
<br>
<br>
Regards,
<br>
Email Artillery
';
}
if($type == 'failure')
{
$post = get_post( $post_id );
$title = $post->post_title;
$permalink = get_permalink( $post_id );
$subject = 'Failed to send out "'.$title.'"';
$message = 'Hey Admin, <br>
<p>We are unable to initiate an Emailing task for your Post "<a href="'.$permalink.'">'.$title.'</a>" right now. You have already sent out emails in current 5 mins. Dont worry we have scheduled a task for it and will be completing it as soon as possible. Sit tight !
</p>
<br>
<p>This Email has been sent automatically by "Email Artillery" wordpress plugin. To stop recieving notification emails follow the following steps:
<br>
1. Login to Wordpress Admin Panel (wp-admin)<br>
2. Go to Email Artillery<br>
3. Disable the "Notifications" in General Settings
</p>
<br>
<br>
<br>
Regards,
<br>
Email Artillery
';
}
if($type == 'initiate')
{
$post = get_post( $post_id );
$title = $post->post_title;
$permalink = get_permalink( $post_id );
$subject = 'Initiated Every 5 Min Task for Post "'.$title.'"';
$message = 'Hey Admin, <br>
<p>We have initiated an Emailing task for your Post "<a href="'.$permalink.'">'.$title.'</a>" right now. You will be recieving an email on completion. Sit tight !
</p>
<br>
<p>This Email has been sent automatically by "Email Artillery" wordpress plugin. To stop recieving notification emails follow the following steps:
<br>
1. Login to Wordpress Admin Panel (wp-admin)<br>
2. Go to Email Artillery<br>
3. Disable the "Notifications" in General Settings
</p>