New lower pricing for Subscriptions

50%off old price

How to send emails?

About Support Bulk email How to send emails?

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2564
    Avatar for Jay JonesJay Jones
    Member

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

    #3353
    Avatar for Jay JonesJay Jones
    Member

    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.

    #3354
    Avatar for Jay JonesJay Jones
    Member

    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?

    #3355
    Avatar for Andy MoyleAndy Moyle
    Keymaster

    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.jpg

    #3356
    Avatar for Andy MoyleAndy Moyle
    Keymaster

    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

    #3357
    Avatar for Jay JonesJay Jones
    Member

    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.

    #3358
    Avatar for Andy MoyleAndy Moyle
    Keymaster

    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:
    $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

    }

    }
    ?>

    #3359
    Avatar for Andy MoyleAndy Moyle
    Keymaster

    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 šŸ˜³

    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’);

    and it’ll work if you are a wp-cron kind of guy.

    Another next release fix!

    #3360
    Avatar for Jay JonesJay Jones
    Member

    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!

    #3361
    Avatar for Jay JonesJay Jones
    Member

    Excellent! (my post crossed yours :))

    #3362
    Avatar for Jay JonesJay Jones
    Member

    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!?

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.