TagoIO SDK for JavaScript and TypeScript
    Preparing search index...

    Class SMTP

    Hierarchy

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Send email using SMTP Integration

      Parameters

      Returns Promise<string>

      A promise that resolves to a success message

      This method requires either a TagoIO SMTP Secret or SMTP credentials. For enhanced security, it's strongly recommended to use TagoIO Secrets rather than hardcoding credentials.

      const environment = Utils.envToJson(context.environment);
      const emailService = new Services({ token: context.token }).smtp;
      const result = await emailService.send({
      to: "client@company.com",
      subject: "Reports",
      message: "Hello client, it's your report",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      console.log(result);
      // Using an array of recipients
      const result = await emailService.send({
      to: ["client1@company.com", "client2@company.com"],
      subject: "Reports",
      message: "Hello clients, it's your report",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      // Sending HTML content
      const result = await emailService.send({
      to: "client@company.com",
      subject: "Reports",
      html: "<p>Hello client, it's your <strong>report</strong></p>",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      // Using a template
      const result = await emailService.send({
      to: "client@company.com",
      template: { name: "my_template" },
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
    • Send email using SMTP Integration

      Parameters

      Returns Promise<string>

      A promise that resolves to a success message

      This method requires either a TagoIO SMTP Secret or SMTP credentials. For enhanced security, it's strongly recommended to use TagoIO Secrets rather than hardcoding credentials.

      const environment = Utils.envToJson(context.environment);
      const emailService = new Services({ token: context.token }).smtp;
      const result = await emailService.send({
      to: "client@company.com",
      subject: "Reports",
      message: "Hello client, it's your report",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      console.log(result);
      // Using an array of recipients
      const result = await emailService.send({
      to: ["client1@company.com", "client2@company.com"],
      subject: "Reports",
      message: "Hello clients, it's your report",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      // Sending HTML content
      const result = await emailService.send({
      to: "client@company.com",
      subject: "Reports",
      html: "<p>Hello client, it's your <strong>report</strong></p>",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      // Using a template
      const result = await emailService.send({
      to: "client@company.com",
      template: { name: "my_template" },
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
    • Send email using SMTP Integration

      Parameters

      Returns Promise<string>

      A promise that resolves to a success message

      This method requires either a TagoIO SMTP Secret or SMTP credentials. For enhanced security, it's strongly recommended to use TagoIO Secrets rather than hardcoding credentials.

      const environment = Utils.envToJson(context.environment);
      const emailService = new Services({ token: context.token }).smtp;
      const result = await emailService.send({
      to: "client@company.com",
      subject: "Reports",
      message: "Hello client, it's your report",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      console.log(result);
      // Using an array of recipients
      const result = await emailService.send({
      to: ["client1@company.com", "client2@company.com"],
      subject: "Reports",
      message: "Hello clients, it's your report",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      // Sending HTML content
      const result = await emailService.send({
      to: "client@company.com",
      subject: "Reports",
      html: "<p>Hello client, it's your <strong>report</strong></p>",
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });
      // Using a template
      const result = await emailService.send({
      to: "client@company.com",
      template: { name: "my_template" },
      smtp_secret: environment.SMTP_TAGOIO_SECRET
      });