示例#1
0
def attempt_fix(database, record, task, e):
    # Sometimes a user is in basket's database but not in
    # ExactTarget because the API failed or something. If that's
    # the case, any future API call will error because basket
    # won't add the required CREATED_DATE field. Try to add them
    # with it here.
    if e.message.find('CREATED_DATE_') != -1:
        record['CREATED_DATE_'] = gmttime()
        sfmc.add_row(database, record)
    else:
        raise e
示例#2
0
def record_source_url(email, source_url, newsletter_id):
    if not source_url:
        source_url = '__NONE__'
    else:
        source_url = source_url[:1000]

    sfmc.add_row('NEWSLETTER_SOURCE_URLS', {
        'Email': email,
        'Signup_Source_URL__c': source_url,
        'Newsletter_Field_Name': newsletter_id,
        'Newsletter_Date': gmttime(),
    })
示例#3
0
def add_sms_user_optin(mobile_number):
    record = {'Phone': mobile_number, 'SubscriberKey': mobile_number}
    sfmc.add_row('Mobile_Subscribers', record)
示例#4
0
def add_sms_user_optin(mobile_number):
    record = {'Phone': mobile_number, 'SubscriberKey': mobile_number}
    sfmc.add_row('Mobile_Subscribers', record)