library-ts/node/users/email/RokojoriEmail.ts

44 lines
896 B
TypeScript
Raw Normal View History

2025-11-11 13:13:39 +00:00
import { Message } from "../../../browser/messages/Message";
import { RJLog } from "../../log/RJLog";
import { Request } from "../../web/Request";
import { EmailService } from "./EmailService";
export class EmailData
{
to:string;
subject:string;
message:string;
reply:string;
key:string;
}
export class RokojoriEmail extends EmailService
{
_key:string;
constructor( key:string )
{
super();
this._key = key;
}
async send( reply:string, to:string, subject:string, message:string ):Promise<void>
{
let emailData =
{
to: to,
subject: subject,
message: message,
reply: reply,
key: this._key
};
let url = "https://rokojori.com/_php/backend/email.php";
let result = await Request.postJSON<EmailData,Message>( url, emailData );
2025-11-11 13:57:12 +00:00
RJLog.log( "Email", emailData, ">>", result );
2025-11-11 13:24:34 +00:00
return Promise.resolve();
2025-11-11 13:13:39 +00:00
}
}