Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7710777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:12:30+00:00 2026-06-01T01:12:30+00:00

I am developing a site to add events to a Google Calendar using code

  • 0

I am developing a site to add events to a Google Calendar using code from this blog post.

Now I want to set a reminder for each event that is set 15 minutes before the event.

Can anyone give me some direction on how to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:12:31+00:00Added an answer on June 1, 2026 at 1:12 am

    Setting a reminder when creating an event is very easy. You just have to add a couple additional lines to the <gd:when></gd:when> tag.

    <gd:when startTime='2006-03-30T22:00:00.000Z' endTime='2006-03-30T23:00:00.000Z'>
      <gd:reminder minutes='15' method='email' />
      <gd:reminder minutes='15' method='alert' />
    </gd:when>
    

    Here’s an updated addEvent() method that includes support for reminders:

    public function addEvent($params) {  
        $url = "http://www.google.com/calendar/feeds/{$this->getFeedEmail()}/private/full";  
    
        //startTime should be a time() value so we can convert it into the correct format  
        $params["startTime"] = date("c", $params["startTime"]);  
    
        //If no end-time is specified, set the end-time to 1 hour after the start-time  
        if(!array_key_exists("endTime", $params)) {  
            $params["endTime"] = date("c", strtotime($params["startTime"])+60*60*1);  
        }  
    
        $reminders = '';
        if(is_array($params['reminders'])) {
            foreach($params['reminders'] as $rem) {
                $reminders .= "<gd:reminder minutes='{$rem['minutes']}' method='{$rem['method']}' />"\n; 
            }
        }
    
        $xml = "<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">  
                  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"></category>  
                  <title type="text">{$params["title"]}</title> 
                  <content type="text">{$params["content"]}</content> 
                  <gd:transparency value="http://schemas.google.com/g/2005#event.opaque">  
                  </gd:transparency>  
                  <gd:eventstatus value="http://schemas.google.com/g/2005#event.confirmed">  
                  </gd:eventstatus>  
                  <gd:where valuestring="{$params["where"]}"></gd:where> 
                  <gd:when starttime="{$params["startTime"]}" endtime="{$params["endTime"]}">
                    {$reminders} 
                  </gd:when> 
                </entry>";  
    
        //Do the initial POST to Google  
        $ret = $this->calPostRequest($url, $xml);  
    
        //If Google sends back a gsessionid, we need to make the request again  
        $matches = array();  
        if(preg_match('/gsessionid=(.*?)\s+/', $ret, $matches)) {  
            $url .= "?gsessionid={$matches[1]}";  
            $ret = $this->calPostRequest($url, $xml);  
        }  
    
        //Parse the XML response (which contains the newly added entry)  
        $retFields = explode("\n", $ret);  
        //print_r($retFields);  
        $entryXML = simplexml_load_string($retFields[count($retFields)-1]);  
    
        //Return an array containing the entry id (url) and the etag  
        return array(  
                "id"=> (string)$entryXML->id,  
                "etag"=> $this->getETagFromHeader($retFields),  
                "link"=> $this->getEditLinkFromHeader($retFields)  
                );  
    }  
    

    And you would call it like this:

    $entryData = $cal->addEvent(array(  
        "title"=> "Auto Test event",  
        "content"=> "This is a test event",  
        "where"=> "Test location",  
        "startTime"=> time()+60*60*24*1,
        "reminders"=> array(
            array("method"=>"email", "minutes"=>"15"),
            array("method"=>"alert", "minutes"=>"15"),
        ) 
    ));  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing site using codeigniter.I have a form which contains add button and
I've been developing a site using ASP.NET MVC, and have decided to use the
I am developing a site using asp.net and C# ( framework 1.1 ). Theres
I am developing a site in vertigoserver. Now I need to test the webpage
I'm developing a site using jQuery, and jQuery UI tabs. For some reason, my
I'm developing a site right now that I've been working on for more than
I am developing a multilingual ASP.NET web site. I want the users to be
I am developing my site. I am using Thestyle Wordpress theme in it. My
I'm currently developing a website and part of it involves using Google Maps. I'd
I'm currently developing a Rails app with 4 nested models (as per THIS POST

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.