No project description provided
Project description
dnoticias_services
Import:
from dnoticias_services.<module> import <function_name>
eg:
from dnoticias_services.mail import send_email
Modules:
- authentication
- payments
- utils
- subscriptions
Methods:
-
Authentication
-
create_user: Creates a new user in keycloak
create_user(email, first_name='', last_name='', enabled=True, email_verified=False, password=None, temporary_password=True, is_staff=False, is_superuser=False, send_email_to_user=False)
-
update_user: Updates an existing user in keycloak and backends
update_user(email, first_name='', last_name='', enabled=True, is_staff=False, is_superuser=False)
-
update_password: Updates an user password. Can send notification emails too.
update_password(email, password, temporary=False, send_email_to_user=False)
-
get_token: Gets an user token.
get_token(email, password)
-
-
Mail
-
create_campaign
create_campaign(template_uuid, brand_group_uuid, newsletter_uuid, title, subject, context=dict(), from_email=None, from_name=None, track_opens=True, track_clicks=True, api_key=None, timeout=None)
-
send_campaign
send_campaign(template_uuid, brand_group_uuid, newsletter_uuid, title, subject, context=dict(), from_email=None, from_name=None, track_opens=True, track_clicks=True, api_key=None, timeout=None)
-
send_email
send_email(email, template_uuid, brand_group_uuid, subject, context=dict(), from_email=None, from_name=None, attachments=[], track_opens=True, track_clicks=True, api_key=None, timeout=None)
-
send_email_bulk
send_email_bulk(emails=[], template_uuid=None, brand_group_uuid=None, subject="", context=list(), from_email=None, from_name=None, attachments=[], track_opens=True, track_clicks=True, api_key=None, timeout=None)
-
-
Payments
-
Items
-
create_item Creates an item from dnoticias-payments via API
create_item(name, slug, price, active=True, extra_attrs=dict(), description="", images=dict(), shippable=False, interval=None, interval_count=None, trial_interval=None, trial_interval_count=None, offers=[], category=None, api_key=None, timeout=None)
-
update_item: Updates an item from dnoticias-payments via API
update_item(uuid, name=None, slug=None, extra_attrs=None, description=None, price=None, active=None, images=None, shippable=None, interval=None, interval_count=None, trial_interval=None, trial_interval_count=None, offers=None, category=None, api_key=None, timeout=None)
-
delete_item: Deletes an item from dnoticias-payments via API
delete_item(uuid, api_key=None, timeout=None)
-
-
Orders
-
get_user_order_datatable: Gets all the user orders from dnoticias-payments. Works only with datatables.
get_user_order_datatable(request, user_id, api_key=None)
-
-
Providers
-
get_payment_providers: Gets all the payment providers with status active created in dnoticias-payments.
get_payment_providers(request, api_key=None)
-
-
-
Utils
-
request_object: Replicates the request object from django. Used to datatables.
Same methods/attrs as the original request. Used to provide the request information to datatables because the original one is inmutable.
-
-
Subscriptions
- get_user_notifications: Gets all the non-opened notifications for an specific user by its email
get_user_notifications(email, api_key=None)
- get_user_components: Gets all the components for an specific user by its email. The response contain paper components and digital components with its roles.
get_user_components(email, api_key=None)
- get_user_notifications: Gets all the non-opened notifications for an specific user by its email
Settings
-
Authentication
- KEYCLOAK_SERVER_URL
- KEYCLOAK_ADMIN_REALM_NAME
- KEYCLOAK_USER_REALM_NAME
- KEYCLOAK_ADMIN_USERNAME
- KEYCLOAK_ADMIN_PASSWORD
- KEYCLOAK_CLIENT_ID
- KEYCLOAK_CLIENT_SECRET_KEY
- DEFAULT_FROM_EMAIL
- MAIL_USER_PASSWORD_NOTIFICATION_TEMPLATE_UUID
- EMAIL_BRAND_GROUP_UUID
- MAIL_USER_PASSWORD_NOTIFICATION_SUBJECT
- MAIL_USER_CREATION_SUBJECT
-
Mail
- MAIL_SERVICE_ACCOUNT_API_KEY
- MAIL_SERVICE_REQUEST_TIMEOUT
- SEND_EMAIL_API_URL (https://comunicacao.dnoticias.pt/api/send/mail/)
- SEND_EMAIL_BULK_API_URL (https://comunicacao.dnoticias.pt/api/send/mail/bulk/)
- SEND_CAMPAIGN_API_URL (https://comunicacao.dnoticias.pt/api/send/campaign/)
- CREATE_CAMPAIGN_API_URL (https://comunicacao.dnoticias.pt/api/send/create/campaign/)
- EMAIL_USER_DATATABLE_LIST_API_URL (http://xyz.dnoticias.pt/api/user/{}/mails/datatable/)
-
Payments
- PAYMENT_SERVICE_ACCOUNT_API_KEY
- PAYMENT_SERVICE_REQUEST_TIMEOUT
- ITEM_API_URL (http://xyz.dnoticias.pt/api/items/)
- ORDER_USER_DATATABLE_LIST_API_URL (http://payments.dnoticias.pt/api/user/{}/orders/datatable/)
- PAYMENT_PROVIDERS_SELECT2VIEW_API_URL (http://payments.dnoticias.pt/api/payment/providers/select2/{}/)
-
Subscriptions
- SUBSCRIPTION_SERVICE_ACCOUNT_API_KEY
- SUBSCRIPTION_SERVICE_REQUEST_TIMEOUT
- USER_NOTIFICATION_API_URL (http://xyz.dnoticias.pt/api/user-notifications/{}/)
- USER_COMPONENTS_API_URL (http://xyz.dnoticias.pt/api/user-components/{}/)
- BILLING_API_URL
- ADDRESS_API_URL
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django_dnoticias_services-1.0.7.28.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3aa9c322267f1138e829bc60cce5eab849e5e9fc7b0559039b7c720df544997 |
|
MD5 | b455b12a9983a14a2e09e7d46f7b05bc |
|
BLAKE2b-256 | 44e2a4d9592d0c795365b6c2b1b684f076753747a6ecdfc0d15f71a0dd1a0e60 |