Files
notifications-admin/app/notify_client/email_branding_client.py

33 lines
968 B
Python
Raw Normal View History

from app.notify_client import NotifyAdminAPIClient
2018-02-07 10:30:49 +00:00
class EmailBrandingClient(NotifyAdminAPIClient):
def __init__(self):
super().__init__("a" * 73, "b")
2018-02-07 10:30:49 +00:00
def get_email_branding(self, branding_id):
return self.get(url='/email-branding/{}'.format(branding_id))
2018-02-07 10:30:49 +00:00
def get_all_email_branding(self):
return self.get(url='/email-branding')['email_branding']
2018-02-07 10:30:49 +00:00
def get_letter_email_branding(self):
return self.get(url='/dvla_organisations')
2017-07-28 15:17:50 +01:00
2018-02-07 10:30:49 +00:00
def create_email_branding(self, logo, name, colour):
2017-07-28 15:17:50 +01:00
data = {
"logo": logo,
"name": name,
"colour": colour
}
2018-02-07 10:30:49 +00:00
return self.post(url="/email-branding", data=data)
2017-07-28 15:17:50 +01:00
2018-02-07 10:30:49 +00:00
def update_email_branding(self, branding_id, logo, name, colour):
2017-07-28 15:17:50 +01:00
data = {
"logo": logo,
"name": name,
"colour": colour
}
2018-02-07 10:30:49 +00:00
return self.post(url="/email-branding/{}".format(branding_id), data=data)