-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.py
25 lines (19 loc) · 943 Bytes
/
api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
from dotenv import load_dotenv
import mailchimp_transactional as MailchimpTransactional
from mailchimp3 import MailChimp
import mailchimp_marketing as MailchimpMarketing
load_dotenv()
MAILCHIMP_TRANSACTIONAL_API_KEY = os.getenv("MAILCHIMP_TRANSACTIONAL_API_KEY")
mailchimp_transactional_api = MailchimpTransactional.Client(MAILCHIMP_TRANSACTIONAL_API_KEY)
MAILCHIMP_MARKETING_API_KEY = os.getenv("MAILCHIMP_MARKETING_API_KEY")
MAILCHIMP_USERNAME = os.getenv("MAILCHIMP_USERNAME")
mailchimp_marketing_vingt_cinq_api = MailChimp(mc_api=MAILCHIMP_MARKETING_API_KEY, mc_user=MAILCHIMP_USERNAME)
MAILCHIMP_SERVER_PREFIX = os.getenv("MAILCHIMP_SERVER_PREFIX")
mailchimp_marketing_api = MailchimpMarketing.Client()
mailchimp_marketing_api.set_config({
"api_key": MAILCHIMP_MARKETING_API_KEY,
"server": MAILCHIMP_SERVER_PREFIX
})
MAILCHIMP_LIST_ID = os.getenv("MAILCHIMP_LIST_ID")
RECIPIENT_EMAIL = os.getenv("RECIPIENT_EMAIL")