def METHOD_NAME(
    db_session: SessionLocal, project: Project, owner_email: str, resource_groups: Any
):
    """Contains the logic for evergreen reminders."""
    plugin = plugin_service.get_active_instance(
        db_session=db_session, plugin_type="email", project_id=project.id
    )
    if not plugin:
        log.warning(
            "Evergreen reminder not sent. No email plugin enabled. Project: {project.name}. Organization: {project.organization.name}"
        )
        return
    items = []
    for resource_type, resources in resource_groups.items():
        for resource in resources:
            weblink = getattr(resource, "weblink", "N/A")
            items.append(
                {
                    "description": getattr(resource, "description", None),
                    "name": resource.name,
                    "project": resource.project.name,
                    "resource_type": resource_type.replace("_", " ").title(),
                    "weblink": weblink,
                }
            )
    notification_template = EVERGREEN_REMINDER
    notification_type = "evergreen-reminder"
    name = subject = notification_text = "Evergreen Reminder"
    # Can raise exception "tenacity.RetryError: RetryError". (Email may still go through).
    success = False
    try:
        success = plugin.instance.send(
            owner_email,
            notification_text,
            notification_template,
            notification_type,
            name=name,
            subject=subject,
            items=items,  # plugin expect dicts
        )
    except Exception as e:
        log.error(f"Error in sending {notification_text} email to {owner_email}: {e}")
    if not success:
        log.error(f"Unable to send evergreen message. Email: {owner_email}")
        return
    # we set the evergreen last reminder at time to now
    for _, resources in resource_groups.items():
        for resource in resources:
            resource.evergreen_last_reminder_at = datetime.utcnow()
    db_session.commit()