mirror of
https://github.com/HeyPuter/puter.git
synced 2026-10-13 15:20:26 +00:00
add API origin to fetchUrl
This commit is contained in:
1 parent
ecc1804630
commit
784f8c4e73
2 files changed
+2
-2
No files matched your search
@@ -129,7 +129,7 @@ export class EmailModule extends PuterModule {
|
||||
});
|
||||
|
||||
send = async (options) => {
|
||||
const req = await fetchUrl("/email/send", {includePuterAuth: true, body: new Blob([await compose(options)], {type: 'message/rfc822'})});
|
||||
const req = await fetchUrl(`${this.APIOrigin}/email/send`, { method: "POST", includePuterAuth: true, body: new Blob([await compose(options)], { type: 'message/rfc822' }) });
|
||||
return await req.json();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ export async function compose({ from, to, cc, bcc, subject, replyTo, attachments
|
||||
} else {
|
||||
// Add From Block (hardcoded to puter.email for now)
|
||||
const userinfo = await puter.getUser();
|
||||
headerLines += emlHeader('From', userinfo + '@puter.email');
|
||||
headerLines += emlHeader('From', userinfo.username + '@puter.email');
|
||||
}
|
||||
|
||||
const { isMultiPart, mimeType } = determineTopLevelMimeType({ attachments, text, html });
|
||||
|
||||
Reference in new issue
Block a user