Public
Back
Version 5
8/10/2023
const email = async (data: {
to: (IAddress | string)[] | IAddress | string;
from: IAddress | string;
cc?: (IAddress | string)[] | IAddress | string;
bcc?: (IAddress | string)[] | IAddress | string;
subject: string;
replyTo?: (IAddress | string)[] | IAddress | string;
html?: string;
text?: string;
}, keys: {
privateKey: {
kty: string;
crv: string;
alg: string;
x: string;
y: string;
d: string;
key_ops: string[];
ext: boolean;
};
publicKey: any;
}) => {
let from = @stevekrouse.thisEmail();
return @stevekrouse.runValAPIAuth({
val: "@stevekrouse.emailAPI",
args: [{
to: @stevekrouse.parseSendGridEmails(data.to),
from: @stevekrouse.parseSendGridEmails(data.from ?? from)[0],
cc: @stevekrouse.parseSendGridEmails(data.cc),
bcc: @stevekrouse.parseSendGridEmails(data.bcc),
subject: data.subject,
html: data.html,
text: data.text,
}],
keys,
});
Updated: October 23, 2023