mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-25 02:31:30 +01:00
1484b846ce
* Added slack configuration options * Added slack selection UI
20 lines
490 B
Python
20 lines
490 B
Python
from datetime import datetime
|
|
from typing import Any
|
|
|
|
import pytz
|
|
|
|
from posthog.models.subscription import Subscription
|
|
|
|
|
|
def create_subscription(**kwargs: Any) -> Subscription:
|
|
payload = dict(
|
|
target_type="email",
|
|
target_value="test1@posthog.com,test2@posthog.com",
|
|
frequency="daily",
|
|
interval=1,
|
|
start_date=datetime(2022, 1, 1, 9, 0).replace(tzinfo=pytz.UTC),
|
|
)
|
|
|
|
payload.update(kwargs)
|
|
return Subscription.objects.create(**payload)
|