• Hi there,

    I like your plugin a lot. It’s fits my needs to 100% and it’s easy to use. Some users of the calendar feed told me, that they are missing the reminder function. After I searched for it, it was clear: The plugin has no reminder function.

    The ICS tags are simple though:

    BEGIN:VALARM
    ACTION:DISPLAY
    TRIGGER:-PT1H
    DESCRIPTION:Some desc of the event 1h before start
    END:VALARM
    
    BEGIN:VALARM
    ACTION:DISPLAY
    TRIGGER:-PT2H
    DESCRIPTION:Some desc of the event 2h before start
    END:VALARM
    
    BEGIN:VALARM
    ACTION:DISPLAY
    TRIGGER:-P1D
    DESCRIPTION:Some desc of the event 1d before start
    END:VALARM

    It’s within the START:VEVENT and END:VEVENT tags.

    Hopefully you find this functions also useful and implement it in the near future.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mikeknappe

    (@mikeknappe)

    I’ve searched within the code and you have a hook, which can be used to modify the alarm for events. Which is awesome and helps a lot, but it would be nice to have a GUI for an event to set individual alarms for each event.
    Beware of the plural: ICS is able to store more than one alarm and the current code is only able to insert one alarm for all events.

    Thread Starter mikeknappe

    (@mikeknappe)

    Well, for those who want to use the hook:

    /**
    * Filter information used to set an alarm on an event in .ics files.
    *
    * @hook mc_event_has_alarm
    *
    * @param {array} Alarm information passable to mc_generate_alert_ical()
    * @param {int}   $event_id Event ID.
    * @param {int}   $post Post ID.
    *
    * @return {array}
    */

    To use it, you create your own plugin or insert something like the following in the functions.php of your theme:

    //Set a default calendar alarm for My Calendar Plugin
    function set_default_calendar_alarm( $retArr, $postId, $postArr )
    {
    	$retArr = array(
    		'TRIGGER' => '-PT2H'
    	);
    	return $retArr;
    }
    add_filter( 'mc_event_has_alarm', 'set_default_calendar_alarm', 10, 3 );
    Plugin Author Joe Dolson

    (@joedolson)

    If you’d be willing to open this as a feature request on the My Calendar Github repository, I’d greatly appreciate it!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘ICS default reminder function is missing’ is closed to new replies.