Skip to content

Commit

Permalink
CIO events on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
elffjs committed Nov 1, 2024
1 parent bd74d78 commit 4510c2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/controller/crud_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ func (d *Controller) CreateAccount(c *fiber.Ctx) error {

if userAccount.EmailAddress != nil {
d.log.Info().Str("account", acct.ID).Msgf("Created account with email %s.", *userAccount.EmailAddress)
if err := d.cioService.SetEmail(acct.ID, *userAccount.EmailAddress); err != nil {
d.log.Err(err).Str("account", acct.ID).Msgf("Error updating Customer.io with email.")
}
} else if userAccount.EthereumAddress != nil {
d.log.Info().Str("account", acct.ID).Msgf("Created account with wallet %s.", *userAccount.EthereumAddress)
if err := d.cioService.SetWallet(acct.ID, *userAccount.EthereumAddress); err != nil {
d.log.Err(err).Str("account", acct.ID).Msgf("Error updating Customer.io with wallet.")
}
}

formattedAcct, err := d.formatUserAcctResponse(acct, acct.R.Wallet, acct.R.Email)
Expand Down

0 comments on commit 4510c2d

Please sign in to comment.