Edits history of script submission #5812 for ' Send app report (smtp)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import nodemailer from "nodemailer";
    type Smtp = {
      host: string;
      port: number;
      user: string;
      password: string;
    };
    type Base64 = string
    export async function main(
      smtp: Smtp,
      screenshot: Base64,
      kind: 'pdf' | 'png',
      to_email: string,
      from_email: string,
      app_path: string,
    ) {
      const transporter = nodemailer.createTransport({
        host: smtp.host,
        port: smtp.port,
        secure: true,
        auth: {
          user: smtp.user,
          pass: smtp.password,
        },
      });
      const fullAppPath = Bun.env["WM_BASE_URL"] + '/apps/get/' + app_path + '?workspace=' + Bun.env["WM_WORKSPACE"]
      return await transporter.sendMail({
        from: from_email,
        to: to_email,
        subject: "App report of " + app_path,
        html: "<p>App report of <a href='" + fullAppPath + "'>" + app_path + "</a></p>",
        attachments: [
          {
            filename: "report." + kind,
            content: Buffer.from(screenshot, "base64"),
          },
        ],
      });
    }

    Submitted by hugo989 10 days ago

  • bun
    import nodemailer from "nodemailer";
    type Smtp = {
      host: string;
      port: number;
      user: string;
      password: string;
    };
    type Base64 = string
    export async function main(
      smtp: Smtp,
      screenshot: Base64,
      kind: 'pdf' | 'png',
      to_email: string,
      from_email: string,
      app_path: string,
    ) {
      const transporter = nodemailer.createTransport({
        host: smtp.host,
        port: smtp.port,
        secure: true,
        auth: {
          user: smtp.user,
          pass: smtp.password,
        },
      });
      const fullAppPath = Bun.env["WM_BASE_URL"] + '/apps/get/' + app_path + '?workspace=' + Bun.env["WM_WORKSPACE"]
      return await transporter.sendMail({
        from: from_email,
        to: to_email,
        subject: "App report of " + app_path,
        html: "<p>App report of <a href='" + fullAppPath + "'>" + app_path + "</a></p>",
        attachments: [
          {
            filename: "report." + kind,
            content: Buffer.from(screenshot, "base64"),
          },
        ],
      });
    }

    Submitted by hugo697 635 days ago

  • bun
    import nodemailer from "nodemailer";
    type Smtp = {
      host: string;
      port: number;
      user: string;
      password: string;
    };
    type Base64 = string
    export async function main(
      smtp: Smtp,
      screenshot: Base64,
      kind: 'pdf' | 'png',
      to_email: string,
      from_email: string,
      app_path: string,
    ) {
      const transporter = nodemailer.createTransport({
        host: smtp.host,
        port: smtp.port,
        secure: true,
        auth: {
          user: smtp.user,
          pass: smtp.password,
        },
      });
      const fullAppPath = Bun.env["WM_BASE_URL"] + '/apps/get/' + app_path + '?workspace=' + Bun.env["WM_WORKSPACE"]
      return await transporter.sendMail({
        from: from_email,
        to: to_email,
        subject: "App report of " + app_path,
        html: "<p>App report of <a href='" + fullAppPath + "'>" + app_path + "</a></p>",
        attachments: [
          {
            filename: "report." + kind,
            content: Buffer.from(screenshot, "base64"),
          },
        ],
      });
    }

    Submitted by hugo697 806 days ago

  • bun
    import nodemailer from "nodemailer";
    type Smtp = {
      host: string;
      port: number;
      user: string;
      password: string;
    };
    export async function main(
      smtp: Smtp,
      pdf: string,
      to_email: string,
      from_email: string,
      app_path: string
    ) {
      const transporter = nodemailer.createTransport({
        host: smtp.host,
        port: smtp.port,
        secure: true,
        auth: {
          user: smtp.user,
          pass: smtp.password,
        },
      });
      return await transporter.sendMail({
        from: from_email,
        to: to_email,
        subject: "App report of " + app_path,
        text: "App report of " + app_path + "\n\n",
        attachments: [
          {
            filename: "report.pdf",
            content: Buffer.from(pdf, "base64"),
          },
        ],
      });
    }
    

    Submitted by hugo697 914 days ago

  • bun
    import nodemailer from "nodemailer";
    type Smtp = {
      host: string;
      port: number;
      user: string;
      password: string;
    };
    type Base64 = string
    export async function main(
      smtp: Smtp,
      screenshot: Base64,
      kind: 'pdf' | 'png',
      to_email: string,
      from_email: string,
      app_path: string,
    ) {
      const transporter = nodemailer.createTransport({
        host: smtp.host,
        port: smtp.port,
        secure: true,
        auth: {
          user: smtp.user,
          pass: smtp.password,
        },
      });
      const fullAppPath = Bun.env["WM_BASE_URL"] + '/apps/get/' + app_path + '?workspace=' + Bun.env["WM_WORKSPACE"]
      return await transporter.sendMail({
        from: from_email,
        to: to_email,
        subject: "App report of " + app_path,
        html: "<p>App report of <a href='" + fullAppPath + "'>" + app_path + "</a></p>",
        attachments: [
          {
            filename: "report." + kind,
            content: Buffer.from(screenshot, "base64"),
          },
        ],
      });
    }
    

    Submitted by hugo697 918 days ago

  • bun
    import nodemailer from "nodemailer";
    type Smtp = {
      host: string;
      port: number;
      user: string;
      password: string;
    };
    export async function main(
      smtp: Smtp,
      pdf: string,
      to_email: string,
      from_email: string,
      app_path: string
    ) {
      const transporter = nodemailer.createTransport({
        host: smtp.host,
        port: smtp.port,
        secure: true,
        auth: {
          user: smtp.user,
          pass: smtp.password,
        },
      });
      return await transporter.sendMail({
        from: from_email,
        to: to_email,
        subject: "App report of " + app_path,
        text: "App report of " + app_path + "\n\n",
        attachments: [
          {
            filename: "report.pdf",
            content: Buffer.from(pdf, "base64"),
          },
        ],
      });
    }
    

    Submitted by hugo697 923 days ago

  • bun
    import nodemailer from "nodemailer";
    type Smtp = {
      host: string;
      port: number;
      user: string;
      password: string;
    };
    export async function main(
      smtp: Smtp,
      pdf: string,
      to_email: string,
      from_email: string,
      app_path: string
    ) {
      const transporter = nodemailer.createTransport({
        host: smtp.host,
        port: smtp.port,
        secure: true,
        auth: {
          user: smtp.user,
          pass: smtp.password,
        },
      });
      return await transporter.sendMail({
        from: from_email,
        to: to_email,
        subject: "App report of " + app_path,
        text: "App report of " + app_path + "\\n\\n",
        attachments: [
          {
            filename: "report.pdf",
            content: Buffer.from(pdf, "base64"),
          },
        ],
      });
    }
    

    Submitted by hugo697 924 days ago