mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-21 04:36:18 +00:00
fix: email driver rename (#3853)
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user