fix: email driver rename (#3853)

This commit is contained in:
Daniel Salazar
2026-09-11 13:58:53 -07:00
committed by GitHub
parent 9940beb4bb
commit 93885dfc54
2 changed files with 9 additions and 7 deletions
+5 -4
View File
@@ -72,7 +72,8 @@ const preprocessSendArgs = (args) => {
};
/**
* Transactional email from your app (the `puter-email` driver interface).
* Transactional email from your app (the `puter-transactional-email` driver
* interface).
*
* Every send must be authorized by a worker: either the worker calls
* directly (`me.puter.email.sendTransactional(...)`), or a user calls with
@@ -119,7 +120,7 @@ export class EmailModule extends PuterModule {
* @type {EmailSendMethod}
*/
sendTransactional = utils.makeDriverMethod({
iface: 'puter-email',
iface: 'puter-transactional-email',
method: 'sendTransactional',
argNames: ['to', 'subject', 'body'],
preprocess: preprocessSendArgs,
@@ -133,8 +134,8 @@ export class EmailModule extends PuterModule {
* @type {EmailSendMethod}
*/
send = utils.makeDriverMethod({
iface: 'puter-email',
method: 'send',
iface: 'puter-transactional-email',
method: 'sendTransactional',
argNames: ['to', 'subject', 'body'],
preprocess: preprocessSendArgs,
});
@@ -167,7 +167,7 @@ export default suite('system', {
t.assert.equal(error.code, 'not_found');
t.assert.equal(
error.message,
'Driver not found: puter-email:(no default)',
'Driver not found: puter-transactional-email:(no default)',
);
},
@@ -184,11 +184,12 @@ export default suite('system', {
t.assert.equal(error.code, 'not_found');
t.assert.equal(
error.message,
'Driver not found: puter-email:(no default)',
'Driver not found: puter-transactional-email:(no default)',
);
},
// `send` is the pre-rename alias: same wire shape, same error path.
// `send` is the deprecated alias that now targets `sendTransactional`
// directly, so both hit the same iface+method and the same error path.
'email.send and email.sendTransactional reject identically': async (t) => {
const options = {
to: 'nobody@example.com',