WordPress.org

Support

Support » Plugins and Hacks » Subscribe2 » [Resolved] [Plugin: Subscribe2] Send emails once a week

[Resolved] [Plugin: Subscribe2] Send emails once a week

Viewing 12 replies - 1 through 12 (of 12 total)
  • @criz666,

    Yes, this is possible, it just requires a little bit of code. Subscribe2 uses the intervals that are currently defined in WordPress (and by any plugins that create additional intervals), so all you need to do is add to the available intervals. Use code like this and simply change the interval time (in seconds) and description.

    function add_my_new_sched($sched) {
    	$sched['my_new'] = array('interval' => 2419200, 'display' => 'Four Weekly'));
    	return $sched;
    }
    add_filter('cron_schedules', 'add_my_new_sched');

    hey, thanx a lot for your help…
    just one thing…exactly where should I add this code?
    thanx a lot

    @criz666,

    Either create your own little plugin or into the functions.php file of your active theme.

    copied and pasted but nothing happened….hmmmmm

    @criz666,

    Whoops, syntax error as too many closing brackets. Try this:

    function add_my_new_sched($sched) {
    	$sched['my_new'] = array('interval' => 2419200, 'display' => 'Four Weekly');
    	return $sched;
    }
    add_filter('cron_schedules', 'add_my_new_sched');

    …still nothing happen…
    I copied the code you gave me at the end of the functions.php file of my theme, but I haven’t found any change in the Subscribe2 plugin.
    Am I doing something wrong?

    @criz666,

    I suspect you must be doing something wrong as it works for me. Are you adding the code before the closing ‘?>’ of the functions.php file?

    You could try adding the code as a plugin instead if the functions.php way isn’t working.

    whooops….that was the problem…my fault 😉
    …and if I would like to make it twice a week how do I have to modify the code?
    Thanx again for your patience

    …I mean…if I add the same line of code but changing the secs, I have a fatal error, so I assume I have to add some code to the one you gave me…
    I have 1209600 seconds in two weeks, how can I had this schedule keeping also the four weeks?
    thanx a lot…again ;-)))

    @criz666,

    If you want to add another interval you need to make sure you change the array key name (so $sched[‘my_new2’] – note the addition of the 2) then also change the interval and description.

    thanx a lot mate!!!!!

    Hi Matty

    I tried the below code you gave CriZ666, but it breaks the page, sorry not a php fundi.i inserted it before ?> in functions.php.

    function add_my_new_sched($sched) {
    $sched[‘my_new’] = array(‘interval’ => 2419200, ‘display’ => ‘Four Weekly’);
    return $sched;
    }
    add_filter(‘cron_schedules’, ‘add_my_new_sched’);

    Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Resolved] [Plugin: Subscribe2] Send emails once a week’ is closed to new replies.
Skip to toolbar