({
userId,
email,
name,
}: {
userId: string;
email: string;
name: string | null;
})
| 5 | constructor(private readonly apiKey: string) {} |
| 6 | |
| 7 | async userCreated({ |
| 8 | userId, |
| 9 | email, |
| 10 | name, |
| 11 | }: { |
| 12 | userId: string; |
| 13 | email: string; |
| 14 | name: string | null; |
| 15 | }) { |
| 16 | logger.info(`Loops send "sign-up" event`, { userId, email, name }); |
| 17 | return this.#sendEvent({ |
| 18 | email, |
| 19 | userId, |
| 20 | firstName: name?.split(" ").at(0), |
| 21 | eventName: "sign-up", |
| 22 | }); |
| 23 | } |
| 24 | |
| 25 | async #sendEvent({ |
| 26 | email, |
no test coverage detected