Send email if specific calendar event is present

I’m trying to create and automation that will run at a specific time each day (say 8:30am), check if there is a specific Calendar event in my google calendar (lets call it groceries) for that day, if so send an email.

The body of the email should include a time that is offset from the calendar event start time. So if the event starts at 2pm the email should say 1:30.

I’m having a hard time wrapping my head around the calendars in general

alias: Email Grocery Calendar
variables:
  calendar_ent: "calendar.groceries"
  search_term: "grocery"
trigger:
  - platform: time
    at: "08:30:00"
condition: []
action:
  - service: calendar.get_events
    metadata: {}
    data:
      duration:
        hours: 24
        minutes: 0
        seconds: 0
      start_date_time: "{{ today_at() }}"
    response_variable: agenda
    target:
      entity_id: "{{calendar_ent}}"
  - variables:
      events: "{{ agenda[calendar_ent].events }}"
      match: "{{ events| selectattr('summary', 'search', search_term) | list }}"
  - condition: template
    value_template: "{{ match|count > 0 }}"
  - service: notify.ha_to_email
    metadata: {}
    data:
      message: |
        {% set g_event = match|first %}
        {{ (g_event.start|as_datetime|as_local -timedelta(minutes=30)).strftime('%H:%M') }}
        
        {{ g_event.summary }}
        
        {{ g_event.description }}
      title: Today's Grocery Event
mode: single

Awesome thanks a bunch that did the trick.

any tips on how to get a new line in the body of the email?