Generate clients (#206)

This commit is contained in:
Janos Dobronszki
2021-09-16 12:52:36 +01:00
committed by GitHub
parent 552c321dd7
commit d4d9c1c176
334 changed files with 9334 additions and 45 deletions

View File

@@ -0,0 +1,24 @@
import * as user from "m3o/user";
// Send a verification email
// to the user being signed up. Email from will be from 'support@m3o.com',
// but you can provide the title and contents.
// The verification link will be injected in to the email as a template variable, $micro_verification_link.
// Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link'
// The variable will be replaced with an actual url that will look similar to this:
// 'https://user.m3o.com/user/verify?token=a-verification-token&rediretUrl=your-redir-url'
async function SendVerificationEmail() {
let userService = new user.UserService(process.env.MICRO_API_TOKEN);
let rsp = await userService.sendVerificationEmail({
email: "joe@example.com",
failureRedirectUrl: "https://m3o.com/verification-failed",
fromName: "Awesome Dot Com",
redirectUrl: "https://m3o.com",
subject: "Email verification",
textContent:
"Hi there,\n\nPlease verify your email by clicking this link: $micro_verification_link",
});
console.log(rsp);
}
await SendVerificationEmail();