November 23, 2017

Toggle email invoice notifications

Toggle email invoice notifications
Disable the email invoice after creation option.

Important manual pages:

import SoftLayer
import json

userName = "set me"

client = SoftLayer.Client()
accountService = client['SoftLayer_Account']
userService = client['SoftLayer_User_Customer']

objectFilterUser = {"users": {"username": {"operation": userName}}}

    users = accountService.getUsers(filter=objectFilterUser)
    result = userService.deactivateNotificationSubscriber(
        "BILLING_INVOICE_CREATED", users[0]['accountId'], id=users[0]['id'])

    # ENABLE
    # result = userService.createNotificationSubscriber(
        "BILLING_INVOICE_CREATED", users[0]['accountId'], id=users[0]['id'])
    print(json.dumps(result, sort_keys=True, indent=2, separators=(',', ': ')))

except SoftLayer.SoftLayerAPIError as e:
    print("Unable to disable the email invoice after creation option. faultCode=%s, faultString=%s" % (e.faultCode, e.faultString))


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue