By default, CoreBase sends a simple welcome email when someone signs up through
User Accounts. Custom email templates let you replace it with your own.
If a template exists for your project, it’s used automatically in place of the default
welcome email — you don’t need to wire anything up beyond creating it.
Create a Template
const { data, error } = await corebase.customEmail.create({
name: 'welcome',
subject: 'Welcome to {{projectName}}, {{name}}!',
body: '<p>Hi {{name}}, thanks for signing up.</p>',
});
List, Get, Update, Delete
const { data: templates } = await corebase.customEmail.list();
const { data } = await corebase.customEmail.get(template.id);
await corebase.customEmail.update(template.id, { subject: 'Welcome aboard, {{name}}!' });
await corebase.customEmail.delete(template.id);
Send Manually
Outside the automatic signup flow, you can send a template directly:
await corebase.customEmail.send(template.id, {
to: 'user@example.com',
name: 'Ada',
projectName: 'My App',
});