Edits history of script submission #371 for ' send an email with aws ses (aws-ses)'

  • deno
    One script reply has been approved by the moderators
    Ap­pro­ved
    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/[email protected]/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 hugo697 389 days ago

  • deno
    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/[email protected]/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 1021 days ago

  • deno
    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/[email protected]/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 1025 days ago

  • deno
    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/[email protected]/client/mod.ts";
    
    import type { Resource } from "https://deno.land/x/[email protected]/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 1104 days ago