await resources.run.userCreate(data);
context.log(`User created with email: ${email}`);
// Sending an email to the new user
const services = new Services({ token: environment.accountToken });
await services.email.send({
to: email,
subject: "Welcome",
message: `Hello ${name},Welcome to our portal!,
});
context.log("Email sent to the new user successfully.");
} catch (error) {
context.log(`Failed to create user or send email: ${error}`);
}
}
}