Support Forum

If you want to show a shortcode in forum post - use [ instead of [ as you write it so you can see the shortcode 😉

We use and recommend UK2 for hosting - get a month free

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register sp_MemberList Members

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
How to send emails?
3rd March 2011
9:42 pm
Avatar
Member
Members
Forum Posts: 19
Member Since:
17th February 2011
sp_UserOfflineSmall Offline

I have found the settings to modify, but I don't see where to actually send messages.

3rd March 2011
10:29 pm
Avatar
Member
Members
Forum Posts: 19
Member Since:
17th February 2011
sp_UserOfflineSmall Offline

A quick followup... I do not have options in my navigation to send email or sms. I tried appending "church_admin_send_email" to the end of my admin URL, and am given the error, "You do not have sufficient permissions to access this page."

I'm not sure why this would be. I am the full admin of the WP installation.

3rd March 2011
10:37 pm
Avatar
Member
Members
Forum Posts: 19
Member Since:
17th February 2011
sp_UserOfflineSmall Offline

A little further investigation... the Index.php has an if() statement at line 142 looking for cronemail.php in the includes folder in order to display the page. Since this file does not exist, it's not showing. Any ideas on this?

3rd March 2011
10:42 pm
Avatar
Admin
Forum Posts: 867
Member Since:
4th March 2015
sp_UserOfflineSmall Offline

Bulk Sms and email will only work once you have filled in and submitted the forms on the "communication settings" page. The form then creates the file that does the sending according to your preferences. Once you have submitted it, a link appears to let you send emails and/or sms

http://www.themoyles.co.uk/wp-content/uploads/2011/03/send_bulk_email.jpgImage Enlarger

If you are finding the plugin useful, please subscribe to the app - it's free for your congregation to use and only £9.99pm for a church subscription - free int'l bank transfers with Revolut

3rd March 2011
11:48 pm
Avatar
Admin
Forum Posts: 867
Member Since:
4th March 2015
sp_UserOfflineSmall Offline

Sorry - my reply has crossed yours!

The cronemail.php file is created when "communication settings" email form is submitted. Hence the if statement in line 142 of index.php.

BTW If you had upgraded the plugin, you have to submit the email settings form, even though the values are shown, to recreate the cronemail.php file - in the next version, on upgrading, reactivation will check to see if settings have been stored previously and recreate it for you

If you are finding the plugin useful, please subscribe to the app - it's free for your congregation to use and only £9.99pm for a church subscription - free int'l bank transfers with Revolut

4th March 2011
10:18 pm
Avatar
Member
Members
Forum Posts: 19
Member Since:
17th February 2011
sp_UserOfflineSmall Offline

Hmm... I appreciate the reply! I've submitted the form a few times, and this file isn't getting created. Not sure why that would be.

4th March 2011
10:37 pm
Avatar
Admin
Forum Posts: 867
Member Since:
4th March 2015
sp_UserOfflineSmall Offline

Must be some sort of permission issue - although though that should have thrown an error. Check the permissions on the include directory.

I've had the plugin working on a number of sites I own and a client and it's created the file well on unix servers and my home windows server.

Judging by your earlier post, you sound as though you could create cronemail.php and upload it to the includes file using this code which is for cron type... Just change teh db prefix if it isn't wp_ and add your db login credentials...

[code]<?php

define('DB_NAME', '##');

/** MySQL database username */

define('DB_USER', '##');

/** MySQL database password */

define('DB_PASSWORD', '##');

/** MySQL hostname */

define('DB_HOST', 'localhost');

$attachment=array();

// connect to database

$db=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);

mysql_select_db(DB_NAME);

//initialise phpmailer script

require("class.phpmailer.php");

$mail = new PHPMailer();

//Grab messages

$sql="SELECT * FROM wp_church_admin_email ORDER BY email_id LIMIT 0,90";//change prefix if necessary, 90 is the number of emails per hour. Change as needed!

$result=mysql_query($sql);

if(mysql_num_rows($result)>0)

{//only proceed if emails queued in db

while($row=mysql_fetch_assoc($result))

{

$mail->From = $row['from_email'];

$mail->FromName = "{$row['from_name']}";

$mail->IsHTML(true);

$mail->AddAddress($row['recipient']);

if(!empty($row['copy']))$mail->AddAddress($row['copy']);

if(!empty($row['attachment']))

{

$path=$row['attachment'];

$mail->AddAttachment($path, $name = "", $encoding = "base64",$type = "application/octet-stream");

$attachment[]=$path;

}

$mail->Subject = $row['subject'] ;

$mail->Body=$row['message'];

if($mail->Send())

{

//successful send, so delete from DB

$sql="DELETE FROM wp_church_admin_email WHERE email_id='".mysql_real_escape_string($row['email_id'])."'";//change prefix if necessary

mysql_query($sql)or die(mysql_error());

}

echo $mail->ErrorInfo;

$mail->ClearAllRecipients();//clears all recipients

$mail->ClearCustomHeaders();//clears headers for next message

}

}
?>[/code]

If you are finding the plugin useful, please subscribe to the app - it's free for your congregation to use and only £9.99pm for a church subscription - free int'l bank transfers with Revolut

4th March 2011
10:48 pm
Avatar
Admin
Forum Posts: 867
Member Since:
4th March 2015
sp_UserOfflineSmall Offline

Ah. It's just occurred to me that I've always tested wp-cron after cron - so cronemail.php has been created. If you were setting up the communication settings with wp-cron only, it is never going to work! redface Embarassed

Line 142 of index.php change that if () to
[code]
if(get_option('church_admin_cron')=='wp-cron'||file_exists(CHURCH_ADMIN_INCLUDE_PATH.'cronemail.php')) add_submenu_page('church_admin/index.php', 'Send Bulk Email', 'Send Bulk Email', 'administrator', 'church_admin_send_email', 'church_admin_send_email');
[/code] and it'll work if you are a wp-cron kind of guy.

Another next release fix!

If you are finding the plugin useful, please subscribe to the app - it's free for your congregation to use and only £9.99pm for a church subscription - free int'l bank transfers with Revolut

4th March 2011
10:53 pm
Avatar
Member
Members
Forum Posts: 19
Member Since:
17th February 2011
sp_UserOfflineSmall Offline

Thanks so much, Andy, and thanks for the work you put in on this. My includes directory has 755 permissions, so should be good for this, wouldn't you think?

I'll create this file and see how it goes, thanks for sharing that. Also, in addition to pastoring two churches in Michigan, USA, I am a designer/developer for http://www.visualhero.com and pretty well experienced with php and expert front-end coder... if I can be of any help with this project, please let me know.

Thanks again!

4th March 2011
10:54 pm
Avatar
Member
Members
Forum Posts: 19
Member Since:
17th February 2011
sp_UserOfflineSmall Offline

Excellent! (my post crossed yours :))

4th March 2011
11:18 pm
Avatar
Member
Members
Forum Posts: 19
Member Since:
17th February 2011
sp_UserOfflineSmall Offline

Quick update. I first tried adding your fix to line 142, and then submitting my settings again... the file wasn't created.

I did created it manually though, per your previous post, and it worked like a charm. I still don't know why it didn't create automatically, though!?

Forum Timezone: Europe/London

Most Users Ever Online: 101

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Pastor Andres: 97

Rich Cox: 94

David Z.: 84

rrfranks: 57

seanmcint: 52

Allen: 51

Jon: 44

Gavin: 41

Janeen: 23

365sussex: 21

Member Stats:

Guest Posters: 44

Members: 408

Moderators: 0

Admins: 1

Forum Stats:

Groups: 5

Forums: 14

Topics: 570

Posts: 2120

Administrators: andymoyle: 867