Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let defaultClient = SibApiV3Sdk.ApiClient.instance
- let apiKey = defaultClient.authentications['api-key']
- apiKey.apiKey = process.env.CLEF_API;
- let apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();
- let sendSmtpEmail = new SibApiV3Sdk.SendSmtpEmail();
- sendSmtpEmail.subject = "New password"
- sendSmtpEmail.htmlContent = "Hello " + data.prenom + "\nYour new password is : " + new_password + "\n\nBest regards"
- sendSmtpEmail.sender = "szkglsk@gmail.com"
- sendSmtpEmail.to = req.body.email;
- await apiInstance.sendTransacEmail(sendSmtpEmail).then(
- function (data) {
- console.log('API called successfully. Returned data: ' + JSON.stringify(data))
- return JSON.stringify(data)
- },
- function (error) {
- console.error(error)
- throw error
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement