def create_default_expiration_notifications(name, recipients, intervals=None):
    """
    Will create standard 30, 10 and 2 day notifications for a given owner unless an alternate set of
    intervals is supplied. If standard notifications already exist these will be returned instead of
    new notifications.

    :param name:
    :param recipients:
    :return:
    """
    if not recipients:
        return []

    options = [
        {
            "name": "unit",
            "type": "select",
            "required": True,
            "validation": check_validation(""),
            "available": ["days", "weeks", "months"],
            "helpMessage": "Interval unit",
            "value": "days",
        },
        {
            "name": "recipients",
            "type": "str",
            "required": True,
            "validation": EMAIL_RE.pattern,
            "helpMessage": EMAIL_RE_HELP,
            "value": ",".join(recipients),
        },
    ]

    if intervals is None:
        intervals = current_app.config.get(
            "LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS", [30, 15, 2]
        )

    notifications = []
    for i in intervals:
        n = get_by_label(f"{name}_{i}_DAY")
        if not n:
            inter = [
                {
                    "name": "interval",
                    "type": "int",
                    "required": True,
                    "validation": check_validation(r"^\d+$"),
                    "helpMessage": "Number of days to be alert before expiration.",
                    "value": i,
                }
            ]
            inter.extend(options)
            n = create(
                label=f"{name}_{i}_DAY",
                plugin_name=current_app.config.get(
                    "LEMUR_DEFAULT_NOTIFICATION_PLUGIN", "email-notification"
                ),
                options=list(inter),
                description="Default {interval} day expiration notification".format(
                    interval=i
                ),
                certificates=[],
            )
        notifications.append(n)

    return notifications

    Will create standard 30, 10 and 2 day notifications for a given owner unless an alternate set of
    intervals is supplied. If standard notifications already exist these will be returned instead of
    new notifications.

    :param name:
    :param recipients:
    :return:
    
lemur/notifications/service.py