Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_draft(self, preview_recipients=[]):
CreateSend.api_key = settings.API_KEY
campaign = CSCampaign()
attrs = dict(
client_id=settings.CLIENT_ID,
subject=self.subject,
name=self.name,
from_name=self.from_name,
from_email=self.from_email,
reply_to=self.from_email, # TODO
html_url=self.html_url,
text_url=self.text_url,
list_ids=self.list_ids,
segment_ids=self.segment_ids,
)
try:
campaign_id = campaign.create(**attrs)
self.cm_id = campaign_id