import {
SendEmailRequest,
SES,
} from "https://aws-api.deno.dev/v0.4/services/ses.ts";
// import the base client library
import { ApiFactory } from "https://deno.land/x/aws_api@v0.8.1/client/mod.ts";
// Create sendEmail params
type Aws = {
awsAccessKeyId: string;
awsSecretAccessKey: string;
region: string;
};
export async function main(
toAddresses: string[],
htmlData: string,
textData: string,
subject: string,
source: string,
credentials: Aws,
) {
var params = {
Destination: {
ToAddresses: toAddresses,
},
Message: {
Body: {
Html: {
Charset: "UTF-8",
Data: htmlData,
},
Text: {
Charset: "UTF-8",
Data: textData,
},
},
Subject: {
Charset: "UTF-8",
Data: subject,
},
},
Source: source /* required */,
};
// Create the promise and SES service object
const apiFac = new ApiFactory({
credentials: {
awsAccessKeyId: credentials.awsAccessKeyId,
awsSecretKey: credentials.awsSecretAccessKey,
},
region: credentials.region,
});
const ses = new SES(apiFac);
return await ses.sendEmail(params);
}
Submitted by admin 497 days ago
import {
SendEmailRequest,
SES,
} from "https://aws-api.deno.dev/v0.4/services/ses.ts";
// import the base client library
import { ApiFactory } from "https://deno.land/x/aws_api@v0.8.1/client/mod.ts";
// Create sendEmail params
type Aws = {
awsAccessKeyId: string;
awsSecretAccessKey: string;
region: string;
};
export async function main(
toAddresses: string[],
htmlData: string,
textData: string,
subject: string,
source: string,
credentials: Aws,
) {
var params = {
Destination: {
ToAddresses: toAddresses,
},
Message: {
Body: {
Html: {
Charset: "UTF-8",
Data: htmlData,
},
Text: {
Charset: "UTF-8",
Data: textData,
},
},
Subject: {
Charset: "UTF-8",
Data: subject,
},
},
Source: source, /* required */
};
// Create the promise and SES service object
const apiFac = new ApiFactory({
credentials: {
awsAccessKeyId: credentials.awsAccessKeyId,
awsSecretKey: credentials.awsSecretAccessKey,
},
region: credentials.region,
});
const ses = new SES(apiFac);
return await ses.sendEmail(params);
}
Submitted by admin 500 days ago
import {
SendEmailRequest,
SES,
} from "https://aws-api.deno.dev/v0.4/services/ses.ts";
// import the base client library
import { ApiFactory } from "https://deno.land/x/aws_api@v0.8.1/client/mod.ts";
import type { Resource } from "https://deno.land/x/windmill@v1.101.1/mod.ts";
// Create sendEmail params
export async function main(
toAddresses: string[],
htmlData: string,
textData: string,
subject: string,
source: string,
credentials: Resource<"aws">,
) {
var params = {
Destination: {
ToAddresses: toAddresses,
},
Message: {
Body: {
Html: {
Charset: "UTF-8",
Data: htmlData,
},
Text: {
Charset: "UTF-8",
Data: textData,
},
},
Subject: {
Charset: "UTF-8",
Data: subject,
},
},
Source: source, /* required */
};
// Create the promise and SES service object
const apiFac = new ApiFactory({
credentials: {
awsAccessKeyId: credentials.awsAccessKeyId,
awsSecretKey: credentials.awsSecretAccessKey,
},
region: credentials.region,
});
const ses = new SES(apiFac);
return await ses.sendEmail(params);
}
Submitted by sindre svendby964 579 days ago