Changeset View
Changeset View
Standalone View
Standalone View
lib/app/base-chips/collections/password-reset-intents.js
Show All 25 Lines | new app.Sealious.EventMatchers.Collection({ | ||||
collection_name: "password-reset-intents", | collection_name: "password-reset-intents", | ||||
action: "create", | action: "create", | ||||
}), | }), | ||||
async ({ metadata }, intent) => { | async ({ metadata }, intent) => { | ||||
const token = (await app.run_action( | const token = (await app.run_action( | ||||
new app.Sealious.SuperContext(metadata.context), | new app.Sealious.SuperContext(metadata.context), | ||||
["collections", "password-reset-intents", intent.id], | ["collections", "password-reset-intents", intent.id], | ||||
"show" | "show" | ||||
)).body.token; | )).token; | ||||
const message = await app.MailTemplates.PasswordReset(app, { | const message = await app.MailTemplates.PasswordReset(app, { | ||||
email_address: intent.body.email, | email_address: intent.email, | ||||
token, | token, | ||||
}); | }); | ||||
await message.send(app); | await message.send(app); | ||||
} | } | ||||
); | ); | ||||
return declaration; | return declaration; | ||||
}; | }; |