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