def notify_account_activation(self, user): """Notify Iterable of a `user` activation event """ # avoid circular import from htk.lib.iterable.utils import get_workflow_id account_activation_workflow_id = get_workflow_id('account.activation') if account_activation_workflow_id is not None: payload = { 'dataFields' : { 'userId' : user.id, 'date_activated' : utcnow().strftime(ITERABLE_DATE_FORMAT), }, } self.trigger_workflow(user.profile.confirmed_email or user.email, account_activation_workflow_id, payload=payload)
def notify_login(self, user): """Notify Iterable of a `user` login event """ # avoid circular import from htk.lib.iterable.utils import get_workflow_id login_workflow_id = get_workflow_id('account.login') if login_workflow_id is not None: payload = { 'dataFields' : { 'userId' : user.id, 'last_login' : user.last_login.strftime(ITERABLE_DATE_FORMAT), }, } self.trigger_workflow(user.profile.confirmed_email or user.email, login_workflow_id, payload=payload)
def notify_login(self, user): """Notify Iterable of a `user` login event """ # avoid circular import from htk.lib.iterable.utils import get_workflow_id login_workflow_id = get_workflow_id('login') if login_workflow_id is not None: payload = { 'dataFields' : { 'userId' : user.id, 'last_login' : user.last_login.strftime(ITERABLE_DATE_FORMAT), }, } self.trigger_workflow(user.email, login_workflow_id, payload=payload)
def notify_account_activation(self, user): """Notify Iterable of a `user` activation event """ # avoid circular import from htk.lib.iterable.utils import get_workflow_id account_activation_workflow_id = get_workflow_id('account_activation') if account_activation_workflow_id is not None: payload = { 'dataFields' : { 'userId' : user.id, 'date_activated' : utcnow().strftime(ITERABLE_DATE_FORMAT), }, } self.trigger_workflow(user.email, account_activation_workflow_id, payload=payload)
def notify_sign_up(self, user): """Notify Iterable of a `user` sign up event Based on HTK settings, either track an event, trigger a workflow, or both """ # avoid circular import from htk.lib.iterable.utils import get_workflow_id sign_up_workflow_id = get_workflow_id('account.sign_up') if sign_up_workflow_id is not None: payload = { 'dataFields' : { 'userId' : user.id, 'date_joined' : user.date_joined.strftime(ITERABLE_DATE_FORMAT), }, } self.trigger_workflow(user.profile.confirmed_email or user.email, sign_up_workflow_id, payload=payload)
def notify_sign_up(self, user): """Notify Iterable of a `user` sign up event Based on HTK settings, either track an event, trigger a workflow, or both """ # avoid circular import from htk.lib.iterable.utils import get_workflow_id sign_up_workflow_id = get_workflow_id('sign_up') if sign_up_workflow_id is not None: payload = { 'dataFields' : { 'userId' : user.id, 'date_joined' : user.date_joined.strftime(ITERABLE_DATE_FORMAT), }, } self.trigger_workflow(user.email, sign_up_workflow_id, payload=payload)
def notify_account_activation(self, user): """Notify Iterable of a `user` activation event """ from htk.lib.iterable.utils import get_workflow_id account_activation_workflow_id = get_workflow_id('account_activation') pass