WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] Send emails once a week (13 posts)

  1. CriZ666
    Member
    Posted 1 year ago #

    Hey, is there any way I can send out my newsletter once a month or twice a week instead of weekly???

    cheers

    http://wordpress.org/extend/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @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');
  3. CriZ666
    Member
    Posted 1 year ago #

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

  4. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @CriZ666,

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

  5. CriZ666
    Member
    Posted 1 year ago #

    copied and pasted but nothing happened....hmmmmm

  6. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @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');
  7. CriZ666
    Member
    Posted 1 year ago #

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

  8. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

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

  9. CriZ666
    Member
    Posted 1 year ago #

    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

  10. CriZ666
    Member
    Posted 1 year ago #

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

  11. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

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

  12. CriZ666
    Member
    Posted 1 year ago #

    thanx a lot mate!!!!!

  13. shanejose@gmail.com
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags