44 lines
896 B
TypeScript
44 lines
896 B
TypeScript
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 );
|
|
|
|
RJLog.log( "Email", emailData, ">>", result );
|
|
|
|
return Promise.resolve();
|
|
}
|
|
} |